Page 1 of 1

Some real noob help need.

Posted: Tue Aug 27, 2002 5:28 am
by MarKeR
Sorry about asking a noob question again.

First things first, I am running the PHPDev Kit which has Apache 1.3.20 and PHP 4.06 inside. I am running this on win 98 on my laptop and XP Pro on my Desktop. The question is do I need to have PWS running as well on my win98 machine. The reason why, I have made a form just to submit a First name (told you I am a noob), every time I submit the form I get a blank page on my results page. I have tried using print $variable and also tried the latest update $_POST or $_GET, both have the same result.

Below is the code for the form and the results. I have looked in the PHP manual and copied directly across but same results.

As I said I am a complete noob at php so bare with me please.

BTW No settings change on the PHPDev kit.


For form.

Code: Select all

<HTML>
<HEAD>
  <TITLE>HTML Form</TITLE>
<HEAD>
<BODY BGCOLOR="#000000">
<FORM ACTION="HandleForm.php"  METHOD=POST>

<FONT COLOR="FFFFFF""> First Name <INPUT TYPE=TEXT NAME="FirstName" Size=20><BR>
<INPUT TYPE=SUBMIT NAME="Submit" Value="Submit!">

</FORM>
</BODY>
</HTML>
For Results

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
  <TITLE>Form Result</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">
<?php
print Your name is $FirstName.<BR>\n;
?>

</BODY>
</HTML>

Posted: Tue Aug 27, 2002 5:33 am
by m3mn0n
You didn't write the print command correctly ;)

Code: Select all

<?php 
print ("Your name is $FirstName.<BR>\n"); 
?>
..should be somthing like that. 8)

Posted: Tue Aug 27, 2002 5:35 am
by m3mn0n
btw, the BBcode for a code is

Code: Select all

&#1111; code ] Code goes here &#1111;/ code ]
...without the spaces :)

you should use the button located above the messege body in the reply page for easier use. 8)

Posted: Tue Aug 27, 2002 5:36 am
by m3mn0n
...delete this....

Posted: Tue Aug 27, 2002 5:36 am
by mikeq
Don't know if anyone else does this but, I don't use () around the print function

$MyVar = "Okay";
print "This will work just as well, $MyVar";

Posted: Tue Aug 27, 2002 5:38 am
by twigletmac
As Oromian said, but you don't need the parenthesis:

Code: Select all

print "Your name is $FirstName.<BR>\n";
You don't need PWS running as you've already got Apache running. Since you're using PHP 4.06 (you should seriously consider upgrading this) then $_POST or $_GET won't work, have you tried $HTTP_POST_VARS and $HTTP_GET_VARS?

Mac

Posted: Tue Aug 27, 2002 5:40 am
by m3mn0n
you don't need parenthesis?!? 8O

...damn that newbie book author... ;)

Posted: Tue Aug 27, 2002 5:42 am
by twigletmac
Some book authors seem to want to make everybody do loads more typing (all those parenthesis must add up :) ) than they need to...

Mac

Posted: Tue Aug 27, 2002 3:26 pm
by Takuma
twigletmac -> Authors are born to do that 8)

Posted: Wed Aug 28, 2002 9:27 am
by gotDNS
use echo, it sounds kooler.

Code: Select all

<?php
echo "Your name is $FirstName.<br />\n";
?>

Posted: Wed Aug 28, 2002 4:25 pm
by Takuma
lol, not much difference.