What would cause my broken url??

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
bassphreek
Forum Newbie
Posts: 4
Joined: Fri Apr 02, 2004 12:40 pm

What would cause my broken url??

Post by bassphreek »

One of my pages is sending broken information. There is a form that generates a list of names with radio buttons next to them. The user selects a name and clicks submit .... then the page proceedes to the next one where I do all my database manipulation.

The problem is, when i select a man and hit submit, my link comes out all messed up. Instead of getting

&information="Lastname, Firstname"
...I get
&information="Lastname, "

I have used this technique on many of my other pages for this website. All the other variables that I pass are ok. This is the only one i have an issue with. Please help me. Im balding as it is, I don't need to start pulling out what hair I have left. Thanks
bassphreek
Forum Newbie
Posts: 4
Joined: Fri Apr 02, 2004 12:40 pm

i got it!

Post by bassphreek »

it was just one huge brain fart!!!!

i had this

Code: Select all

<?php
echo "  <td><input type="radio" name="player" value=$goalie><td></tr>\n";
?>
i needed this

Code: Select all

<?php
echo "  <td><input type="radio" name="player" value="$goalie"><td></tr>\n";
?>
Quotation marks will soon be the death of me!
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

... I'm guesing your passing these throught eh URL using the GET method. And It looks like there is a space after taht comma. And if you are using Apache, then everything after a space in the QUERY_STRING gets pushed back into SERVER_PROTOCOL. So you have two choices... You can
1)Get the remainder of the name by doing something similar to:

Code: Select all

$name = substr(getenv('SERVER_PROTOCOL'), 0, strpos(getenv('SERVER_PROTOCOL'), " HTTP"));
or 2) Change the Name to soemthing like LASTNAME,_FIRSTNAME, then once you get it fromt he URL replace teh _ with a space....
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

oh ya, forgot to mention that i had a simlar problem, thats why i know that! and know one else here probably does...
viewtopic.php?t=17798&postdays=0&postorder=asc&start=0
Post Reply