 |
 |
Stuck on this PHP problem...
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status:
Offline
|
|
Hi giys, i have been stuck trying atthis stage for a week now. Very frustrating. I seem to understand exactly what i am doing but i cannot get this to work. Please help.
I am basically using the php.net manual to learn. Here is a link to the page i am getting my instructions from.
http://us4.php.net/manual/en/tutorial.forms.php
I am trying to use this script (example 2-6):
(i am using the "code" vb-tags like it says in the macnn faq but they dont seem to be working on my comp as i see the form)
Code:
<form action="action.php" method="POST">
Your name: <input type="text" name="name" />
Your age: <input type="text" name="age" />
<input type="submit">
</form>

with this as the action.php acript:
Code:
Hi <?php echo $_POST["name"]; ?>.
You are <?php echo $_POST["age"]; ?> years old.
but unfortunately i get this: - see how it is missing my name and age, the 2 variables?
Obviously the variables are not transfering although the script seems to be working. I am triple checking my code but seeing as it is one line, i can't be that f*cking stupid. I can't seem to process any php scripts with variables. i can use the print and php_info commands with no probblems. My php via fireserv is running:
I have tried:
typing out the script by hand
copy/pasting it (but checking to see the code has no extra characters)
using other similar scripts (get the same results, variables dont transfer and i get something always like above)
i uploaded my test files here, if you want to see them:
http://jacktse.com/php_help/
please help, thanks
(Last edited by Apple Pro Underwear; Aug 31, 2003 at 10:08 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Registered User
Join Date: Jul 2003
Location: San Jose
Status:
Offline
|
|
seems to work fine...

|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
worked for me too. although, i think it lied about my age. you might wanna work on that.
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status:
Offline
|
|
HOW IS THAT POSSIBLE!!!!!!!!!!!!!!!
I DO NOT PAY FOR PHP ON MY ACCOUNT!!!!!!!!!!!!!!!!!
WHY IS GOD PUNISHING ME!!!!!!!
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
You have to run it through your webserver, not just the file. As in, opening the file through C  path\to\file will not work, but 127.0.0.1\path\to\file will. If apache doesn't fill the request it won't be properly parsed.
|
|
Travis Sanderson
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status:
Offline
|
|
status: it seems to work on my localhost path through fireserv now....
so i don't know why it didn't work last week and all yesterday.
in the images i have the path c  fireserv\www\ (i opened it through the folder to take the screenshots) but i have been using http://localhost/.
so thanks, mzllr, philzz, and redjag. frustration is dismounting.
why is it working on my server space though? i do not pay for php service. it is in a generic folder on my webspace and really has no business processing....???
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by Apple Pro Underwear:
why is it working on my server space though? i do not pay for php service. it is in a generic folder on my webspace and really has no business processing....???
Nearly all servers include PHP these days - its pretty much expected (unless its a Windows server, then it would include ASP).
A php script that is run when php is installed, will get processed. Just like if Word is installed on your computer and a word document is opened, Word will open it. You don't need to tell a server "hey, I know you have PHP installed - well can you process only 'this' file, but all those others, don't do them".
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status:
Offline
|
|
Originally posted by thePurpleGiant:
Nearly all servers include PHP these days - its pretty much expected (unless its a Windows server, then it would include ASP).
A php script that is run when php is installed, will get processed. Just like if Word is installed on your computer and a word document is opened, Word will open it. You don't need to tell a server "hey, I know you have PHP installed - well can you process only 'this' file, but all those others, don't do them".
yeah but i dont pay for the service. i'm sure they would not allow php unless i upgraded my monthly payment.
oh well. it works. i got over the hump and can move on.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by Apple Pro Underwear:
WHY IS GOD PUNISHING ME!!!!!!!
...I think he likes ya kid.
|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
Originally posted by thePurpleGiant:
(unless its a Windows server, then it would include ASP).
not 100% guaranteed, to be correct. windoze is just as capable of serving php pages. it's up to the sys admin.
just being pedantic 
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status:
Offline
|
|
pedantic means asshole right?

|
|
|
| |
|
|
|
 |
|
 |
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
we're talking on a Texan scale, yeah
|
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|