Ok I have a script that gets data from a database and when its id is called the url looks like this: index.php?id=2 I have an input box on ?id=2 page, so a user can input a title and I need it to pass the data to a URl like this: index.php?id=2&title=yes problem is all i'm getting is this: index.php?title=yes and its not bringing me to id=2 page. get what i'm saying? heres the form i'm using that is found on index.php?id=2 and not on index.php: <form action="?id='.$row['id'].'" method="get"> Custom Title: <input type="text" name="title" /> <input type="submit" value="Submit" /> </form> Code (markup): trying to get it to send me to index.php?id=2&title=yes
Add: <input type="hidden" name="id" value="2" /> Change the 2 to what your wanted it to show... or whatever $row['id']...
now i have another dilemma. it crops off anything after a space. :\ how would i make it to where it replaces spaces for lets say %20 or whateer ?
Use this code: <form action="index.php" method="get"> <input type="hidden" name="id" value="<?=$row['id']?>"> Custom Title: <input type="text" name="title" /> <input type="submit" value="Submit" /> </form>