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 1379
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 manually type
in the filename the <Img tag works) - how can I get PHP's variable to
be seen as the filename?
Thanks...
<?php
print '<IMG SRC="$php_photo2_file" WIDTH="268" HEIGHT="176" BORDER="0"
|
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" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
|
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, delimiter, thisSoduko, size))
{
std::cout << size;
|
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 Array
Variable values are calculated in the function.
Calling procedure receives the values preferably into variables of the same
| |
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.
What is the syntax to use the same method to pass Integer values to
detailsview?
SelectParameters>
|
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 (me.childname.column(0)," & _
"me.teacher.column(0), me.kidID, " & _
"#" & Me.formdate & "#);"
|
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 have written a case statement for the first display and would like to use it for the other displays instead of having to copy the code. I have tried everything I can think of but can't get it to pass the name of the boolean array im trying to set the...
|
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
------------------------------------------------------------
#!/usr/bin/python
|
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: 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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |