Page 1 of 1

Noob form data question

Posted: Fri Jul 17, 2009 5:10 am
by I0printRob
Hi sorry can't find the answers because my search terms are "get" "post" and "http" which returns the entire internet.

I've done plenty with forms when the action is a relative path. I'm trying to use an absolute path and it's breaking.

So I send 2 fields to a php page

Code: Select all

 
<form method="POST" action="http://www.blahblah.com/test/recieve_form.php">
        <input type="hidden" name="tagsField" id="tagsField" value="originalvalue" />
        <input type="text" name="textField" />      
        <input type="submit" />     
</form>
 
...

Code: Select all

 
<?php
echo $_POST['tagsField'] . "<br />";
echo $_POST['textField'];
?>
 
If I use a relative path it works. If I use an absolute path then there's no entries in $_POST..?
Also when I changed to GET only the first entry is there because of the urlencoding i think (&)

Re: Noob form data question

Posted: Fri Jul 17, 2009 9:33 am
by DaiLaughing
You are spelling receive wrong but as long as you are consistent that shouldn't be the problem!

I can't think of anything as as absolute paths should work.

Re: Noob form data question

Posted: Fri Jul 17, 2009 11:34 am
by pickle
I0printRob wrote:Hi sorry can't find the answers because my search terms are "get" "post" and "http" which returns the entire internet.
That's the funniest thing I've read all day.

I've got nothing to add constructively that ~DaiLaughing hasn't already said.

Re: Noob form data question

Posted: Fri Jul 17, 2009 12:06 pm
by I0printRob
:lol:
Thanks for replying anyhoo.
I've gone back to my test and simply toggled the url from absolute to relative and back - when it's relative, the php returns

Code: Select all

originalvalue<br />asdf<br />
when it's absolute, the php returns

Code: Select all

<br /><br />
Might there be a setting somewhere on my hosting? I don't know what to look for.

Also why does the GET break with an absolute URL (why the &)?

Re: Noob form data question

Posted: Fri Jul 17, 2009 4:41 pm
by pickle
That's really odd - maybe there's a redirect happening so the data is actually being posted, but then you redirect? Like, maybe an http -> https redirect? I don't know - seems like a long shot.

Re: Noob form data question

Posted: Sat Jul 18, 2009 6:44 am
by I0printRob
Bingo! Thanks pickle you the man. I was addressing our .com which is a redirect from a .co.uk, I forgot that was even the case.
Thanks very much for helping me out :)
Rob