Forum Moderators: coopster

Message Too Old, No Replies

Clear the query string from the url and reload

         

ekram

9:39 am on Jan 6, 2005 (gmt 0)

10+ Year Member



i use get method to pass some value from a form and then use an array to store them into corresponding variable name using array['variable name']. now i want to clear the query strings from my url and reload the page.

how?

thanks in advance.

coopster

1:12 pm on Jan 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, ekram.

Can't you just serve up the same page again without the query string?

ekram

6:08 am on Jan 8, 2005 (gmt 0)

10+ Year Member



but how can i do this, i'm a newby in PHP and i know a few functions of PHP and there are a lot of function in PHP so which function i should study for this.

johnt

12:01 pm on Jan 8, 2005 (gmt 0)

10+ Year Member



If want to show the URL without the query string, can't you use the POST method on the form rather than GET?

John

jshpro2

5:25 pm on Jan 8, 2005 (gmt 0)

10+ Year Member



If you simply don't want variables in the URL use POST on your forms.

To load another page just send headers like this:
<?
$url='http://mydomain.com/somefile.php';
header('location:'.$url);
?>

ekram

6:12 am on Jan 9, 2005 (gmt 0)

10+ Year Member



but i found this

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\bel\admin\eqip_list.php:2) in

jshpro2

10:34 pm on Jan 9, 2005 (gmt 0)

10+ Year Member



Put this as your first line of code:
ob_start();

no more error!

ekram

4:36 am on Jan 10, 2005 (gmt 0)

10+ Year Member



thanks, everything works nice.

i'm looking for some good tutorials on php & mysql.
any Suggestions?

jshpro2

11:25 pm on Jan 10, 2005 (gmt 0)

10+ Year Member



Search google, ask questions here..

and the best web site for learning PHP is of course [php.net ]

Best of luck

jatar_k

1:00 am on Jan 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



from our very own Library [webmasterworld.com]

Learning PHP - Books, Tutorials and Online Resources [webmasterworld.com]