Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Stuck on this PHP problem...

Stuck on this PHP problem...
Thread Tools
Addicted to MacNN
Join Date: Sep 2001
Location: NYC*Crooklyn
Status: Offline
Reply With Quote
Aug 31, 2003, 09:50 PM
 
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
Reply With Quote
Sep 1, 2003, 01:05 AM
 
seems to work fine...

     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Sep 1, 2003, 03:39 AM
 
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
Reply With Quote
Sep 1, 2003, 10:13 AM
 
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
Reply With Quote
Sep 1, 2003, 10:41 AM
 
You have to run it through your webserver, not just the file. As in, opening the file through Cpath\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
Reply With Quote
Sep 1, 2003, 11:27 AM
 
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 cfireserv\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
Reply With Quote
Sep 1, 2003, 06:39 PM
 
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
Reply With Quote
Sep 2, 2003, 06:15 AM
 
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
Reply With Quote
Sep 2, 2003, 07:25 AM
 
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
Reply With Quote
Sep 2, 2003, 07:32 AM
 
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
Reply With Quote
Sep 2, 2003, 08:01 PM
 
pedantic means asshole right?

     
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Sep 3, 2003, 01:59 AM
 
we're talking on a Texan scale, yeah
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2