Some real noob help need.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MarKeR
Forum Newbie
Posts: 9
Joined: Mon Aug 26, 2002 7:48 am

Some real noob help need.

Post 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>
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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)
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post 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)
Last edited by m3mn0n on Tue Aug 27, 2002 5:38 am, edited 1 time in total.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

...delete this....
Last edited by m3mn0n on Tue Aug 27, 2002 5:38 am, edited 1 time in total.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post 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";
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

you don't need parenthesis?!? 8O

...damn that newbie book author... ;)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

twigletmac -> Authors are born to do that 8)
User avatar
gotDNS
Forum Contributor
Posts: 217
Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA

Post by gotDNS »

use echo, it sounds kooler.

Code: Select all

<?php
echo "Your name is $FirstName.<br />\n";
?>
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

lol, not much difference.
Post Reply