FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Fields appearing in URL address bar





DoctorBeaver
When I click on the submit button on a form the correct page loads; but contained in the URL in the browser address bar are the values for all the fields in the form.

Obviously I don't want that happening. What causes that and what, if anything, can I do about it?

The form is written in Javascript on a .php page and it loads another .php page.
Atomo64
you have to use the POST method in the form: e.g. <form action="file.php" method="post">

and then in the PHP script you have to use the $_POST superglobal var in order to retrieve the values instead of using $_GET ... but if you are not using any of those vars then your script is most likely to be unsafe if you are using the register_globals feature
DoctorBeaver
I've changed form method from GET to POST and the values are still appearing in the URL bar. Plus when I try to display them in the page that's called (using echo $_POST['whatever']Wink, they're all blank.

UPDATE

Sorted. It was down to browser cache. It wasn't loading the new version of the form. I closed the browser, re-opened it & tried again, and it worked.
Related topics
751 Useful Windows XP Files
(official) Firefox & Thunderbird 1.5 Beta2 Now Available
Fire Fox address bar small icon
Icons in address bar
address bar image
Logo in the address bar ?
FTP Guide
Assigning a variable in PHP by address bar
to compare URL (address line) with some my variable
how to display icon in the the address bar of browser
Javascript, writing code in the address bar without clearing
Delete Data from the Address Bar (Fire Fox and Explorer)
colouring the address bar
Yahoo Search Results from Address Bar of Firefox Searches
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.