I have been wondering if someone can see where my error is. I have been reading a lot of different tutorials and just cannot find my error.
? Should I be using 'isset'
I can get all of the information to display but am not able to pass all of the information on to the next page just some of it. I am confused. -
<?
-
include $include_path."cust_kopf.php";
-
include $include_path."links.php";
-
$andatum2 = $HTTP_GET_VARS['andatum'];
-
$abdatum = $HTTP_GET_VARS['abdatum'];
-
$zimmer = $HTTP_GET_VARS['zimmer'];
-
$andatum2 = $andatum;
-
$andatum=$_POST['andatum'];
-
$abdatum=$_POST['abdatum'];
-
$zimmer=$_POST['zimmer'];
-
?>
-
<? include("$_SERVER[DOCUMENT_ROOT]/css/menu.inc"); ?>
-
<form action="<?php echo $PHP_SELF ?>" method="post">
-
<label>Please type in your billing Zip Code:<br />
-
<input type="text" name="zip" />
-
<?php
-
while (list($name, $value) = each($HTTP_GET_VARS))
-
{
-
echo "<input type=\"hidden\" value=\"$value\" name=\"$name\">\n";
-
}
-
?>
-
</label><br />
-
<input type="submit" value="Get City and State" />
-
</form>
-
<?
-
$zip = $_POST['zip'];
-
$city=$_POST['city'];
-
$plz=$_POST['zip'];
-
$stadt=$_POST['state'];
-
$sql = ("SELECT zip, city, state FROM zip WHERE zip='$zip'");
-
echo '<p>Zip Code:</p>';
-
// Request Zip Code Information
-
$result = @mysql_query($sql);
-
if (!$result) {
-
echo('<p>Error performing query: ' . mysql_error() . '</p>');
-
echo $sql;
-
exit();
-
}
-
// Display the text of zip in a paragraph
-
while ($row = mysql_fetch_array($result)) {
-
if ($zip == 0) {
-
echo "<p> Please enter your Zip Code in the above box or press the continue button to manually enter your information</p>";
-
}
-
else {
-
echo "<p> Your billing Zip Code is <b>{$row['zip']}</b> which is located in <b>{$row['city']}, {$row['state']}</b>. Please press the continue button to enter your information.</p>";
-
}
-
}
-
$row['zip'] = $plz;
-
$stadt=$row['state'];
-
$city=$row['city'];
-
echo '<a href="cust_card.php?andatum='.$andatum.'&abdatum='.$abdatum.'&plz='.$plz.'&city='.$city.'&stadt='.$stadt.'&zimmer='.$zimmer.'&eingabe=1'.'">Continue to enter address</a>';
-
?>
-
-
The last line contains all of the information except for $stadt & $city.
Thanks in advance.
7 1366
It would help if you tell us what the error is you run into. Now we have to guess!
(by the way: don't use HTTP_GET_VARS because it is deprecated and is gone in PHP6, use $_GET instead.)
Ronald :cool:
On the last link to cust_card.php (end of code), all of the values are retrieved and put into the string except for stadt and city. Though they show up initially when you run the first part of the script.
It would help if you tell us what the error is you run into. Now we have to guess!
(by the way: don't use HTTP_GET_VARS because it is deprecated and is gone in PHP6, use $_GET instead.)
Ronald :cool:
On the last link to cust_card.php (end of code), all of the values are retrieved and put into the string except for stadt and city. Though they show up initially when you run the first part of the script.
Below is an example of the output. -
./cust_card.php?andatum=1162573200&abdatum=1162616400&plz=97526&city=&stadt=&zimmer=Space%202&eingabe=1
-
I cleaned up the code to get rid of the "$HTTP_GET_VARS"
The output string is on line 54 and it is not retrieving all of the values. The only ttwo that are not showing is 'city' and 'stadt'. -
<?
-
include $include_path."cust_kopf.php";
-
include $include_path."links.php";
-
$andatum2 = $_GET['andatum'];
-
$abdatum = $_GET['abdatum'];
-
$zimmer = $_GET['zimmer'];
-
$andatum2 = $andatum;
-
$andatum=$_POST['andatum'];
-
$abdatum=$_POST['abdatum'];
-
$zimmer=$_POST['zimmer'];
-
?>
-
<form action="<?php echo $PHP_SELF ?>" method="post">
-
<label>Please type in your billing Zip Code:<br />
-
<input type="text" name="zip" />
-
<?php
-
while (list($name, $value) = each($_GET))
-
{
-
echo "<input type=\"hidden\" value=\"$value\" name=\"$name\">\n";
-
}
-
?>
-
</label><br />
-
<input type="submit" value="Get City and State" />
-
</form>
-
<?
-
$zip = $_POST['zip'];
-
$city=$_POST['city'];
-
$plz=$_POST['zip'];
-
$stadt=$_POST['state'];
-
$sql = ("SELECT zip, city, state FROM zip WHERE zip='$zip'");
-
echo '<p>Zip Code:</p>';
-
// Request Zip Code Information
-
$result = @mysql_query($sql);
-
if (!$result) {
-
// exit('<p>Error performing query: ' . mysql_error() . '</p>');
-
echo('<p>Error performing query: ' . mysql_error() . '</p>');
-
echo $sql;
-
exit();
-
}
-
// Display the text of zip in a paragraph
-
while ($row = mysql_fetch_array($result)) {
-
if ($zip == 0) {
-
echo "<p> Please enter your Zip Code in the above box or press the continue button to manually enter your information</p>";
-
}
-
else {
-
echo "<p> Your billing Zip Code is <b>{$row['zip']}</b> which is located in <b>{$row['city']}, {$row['state']}</b>. Please press the continue button to enter your information.</p>";
-
}
-
}
-
$row['zip'] = $plz;
-
// $row['city'] = $city;
-
// $row['state'] = $stadt;
-
$stadt=$row['state'];
-
$city=$row['city'];
-
-
echo '<a href="cust_card.php?andatum='.$andatum.'&abdatum='.$abdatum.'&plz='.$plz.'&city='.$city.'&stadt='.$stadt.'&zimmer='.$zimmer.'&eingabe=1'.'">Continue to enter address</a>';
-
?>
-
-
When you have a url string and you don't know if there are any funny characters or blanks in it, you better use the url encode function, so: - $url = "?andatum=$andatum&abdatum=$abdatum&plz=$plz&city=$city&stadt=$stadt&zimmer=$zimmer&eingabe=1";
-
$url = urlencode($url);
-
echo "<a href='cust_card.php$url'>Continue to enter address</a>";
Ronald :cool:
I put that the urlencode in and the output is now - cust_kartei.php%3Fandatum%3D1162573200%26abdatum%3D1162616400%26plz%3D97526%26city%3D%26stadt%3D%26zimmer%3DSpace+2%26eingabe%3D1
no longer using the "&"
Still back to the same problem. In that final string, the city and stadt variables are not carrying over.
When you have a url string and you don't know if there are any funny characters or blanks in it, you better use the url encode function, so: - $url = "?andatum=$andatum&abdatum=$abdatum&plz=$plz&city=$city&stadt=$stadt&zimmer=$zimmer&eingabe=1";
-
$url = urlencode($url);
-
echo "<a href='cust_card.php$url'>Continue to enter address</a>";
Ronald :cool:
The fix for the error that I had was to enter in the $stadt and $city right below the 'echo' for the output. -
echo "<p> Your billing Zip Code is <b>{$row['zip']}</b> which is located in <b>{$row['city']}, {$row['state']}</b>. Please press the continue button to enter your information.</p>";
-
$stadt=$row['state'];
-
$city=$row['city'];
-
Again, I want to thank everyone who helped.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ralph Freshour |
last post by:
I'm trying to dynamically load a .jpg image into a html form <Img tag
using a PHP variable that holds the filename of the image but no image
is displaying (the file is there and works because if I...
|
by: Darren Dale |
last post by:
Hello,
def test(data):
i = ? This is the line I have trouble with
if i==1: return data
else: return data
a,b,c,d = test()
|
by: Tom Petersen |
last post by:
I have this code taken from a website that works fine:
<%@ Page Language="vb" ContentType="text/html" ResponseEncoding="iso-8859-1"
Debug="False" trace="False"%>
<%@ import Namespace="System.IO"...
|
by: trickish |
last post by:
In my main I try to get values assigned to "int *thisSoduko" through
the static method Reader::read.
int main(char *args)
{
...
int *thisSoduko = new int;
if(Reader::read( fileName,...
|
by: Dennis D. |
last post by:
Hello:
I want a function to return three variables to the calling procedure:
Private Function CalcTimes(ByVal iAddDays as Integer, ByVal iAddHours as
Integer, ByVal iAddMins as Integer) As...
|
by: Syd_Man |
last post by:
I have a Gridview that is passing value to a detailsview controls using
DefaultValue="EmployeeID = {0}" syntax however if I use the same syntax
for the Integer it raises some Conversion error.
...
|
by: sparks |
last post by:
I was using this to add a record to a table but the systax is messing
me up.
strSQL = "INSERT INTO TblChallengeRECESS ( childname, teacher, kidid,
formdate) " & _
"VALUES...
|
by: JBuckland |
last post by:
Im trying to create a 7 segment display for a project in visual basic 2005 express edition. I have a 2 dimentional boolean which stores the values of each of the segments for a certain display. I...
|
by: mcl |
last post by:
Why can I not the change the value of a variable in another class,
when I have passed it via a parameter list.
I am sure I am being stupid, but I thought passed objects were Read/
Write
eg...
|
by: MM |
last post by:
Hi to all,
I'm trying to import a tab separated values file onto Excel with the
following script:
import csv
from pyExcelerator import *
w = Workbook()
worksheet = w.add_sheet('sim1')
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |