Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 07:55PM

Hey Everybody!

I'm trying to use the <form> command with method="post" and when I display the named variable with:

<html>
<body>
You wrote:
<?php
echo $_post["name"];
?>
</body>
</html>


All I get is "You wrote:"

and everything after that is blank.

I've decided that the post method is not passing the variable array to my .php file.

Is there something that needs to be turned on in the Apache Server or php Server?

Also, there are no error messages in the php error log file.

Please advise.

Peace, Grace & Love;

Lord Cupid

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: yfastud (Moderator)
Date: January 22, 2008 08:03PM

Did you save your file in wamp/www folder and access it through localhost?

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 08:15PM

Yes.

I'm doing everything locally before uploading to my host server (who happens to have the same setup).

Lord Cupid

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 08:34PM

Well, it doesn't do it on the Host computer, either.

So, am I doing something not right, or is there some configuration module that has to take place first?

Lord Cupid

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: yfastud (Moderator)
Date: January 22, 2008 08:40PM

Did you try HTTP_POST_VAR and HTTP_GET_VAR yet?

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 09:55PM

Actually, I don't know what those are and also I can't find any reference to them in the tutorials on php.

How are they used? Is there a $_ that goes in front of them? Is there a configuration in the php.ini files that needs to be set?

Lord Cupid

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 10:40PM

Ok,
I edited the php.ini files on both my WAMP server (in php) and the host server's php.ini file.

Still, no luck.

I set the global vars to On and a few others down the line and yet, nothing.

Where did I go wrong?

Lord Cupid

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: yfastud (Moderator)
Date: January 22, 2008 11:24PM

Oh my goodness! For get about $HTTP_POST_VAR and $HTTP_GET_VAR which are used for older php version, for this version, I found your problem:

<?php
echo $_POST["name"];
?>

Instead:

<?php
echo $_post["name"];
?>

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides



Edited 1 time(s). Last edit at 01/22/2008 11:28PM by yfastud.

Options: ReplyQuote
Re: Post & Get commands not passing variables
Posted by: Lord Cupid (209.183.34.---)
Date: January 22, 2008 11:45PM

OK, YOU WIN!

It's that doggone UPPERCASE thing again! Or Case sensitive or Case sensitivity of it all!

The $_POST works!


You know, when I refer to The LORD, LORD is in all-uppercase. Other than that, I do not type in all uppercase and hitting the shift key for word emphasis is no big deal.

When referring to Jesus, you can write: The Lord Jesus or The Good Lord

When referring to Xanadu The Holy Ghost, you can write: The Lord Xanadu

With that naming convention in mind, everybody will be able to understand who you are writing about.


Now, back to php:

And I did read where php names are indeed case sensitive.

I really appreciate your help!

Grace, Peace & Love;

Lord Cupid

Options: ReplyQuote


Sorry, only registered users may post in this forum.