Problems Refershing Browser
Posted: Mon Jan 02, 2006 3:31 am
Hello
First I want to say that I am fairly new to PHP and Web Developement. I have created web pages before, but not entire sites. So I am in a position now were I need to develope a web site. I chose to go with PHP because of it's flexability and similarity to other languages. Also, as a side note, I am not familar with all of the HTML tags. So yes I may have jumped in some deep water. But I know how to swim and there are plenty of floatation devices on the internet, also this is an opportunity to learn another skill to put under my belt and I am having fun with it.
Ok so here is my problem and maybe my design is wrong so if someone knows a different way please let me know.
I have a page called admin.php, so far all this page does is grab information from a database (MySQL) and displays it in a table. At the bottom of the table there is a text box, two radio buttons, and a submit button. In the textbox the user enters the number of the item to be edited or deleted, depending on which radio button is selected. Edit is selected by default.
When the submit button is clicked the admin page calls up the edit.php page. This page has a switch/case statement with a few functions. The default of the switch/case statement is a call to the init function which initializes the variables with the selection the the user made from the database.
Now what I want to do is, after the init function is called is to refresh the browser. My flag variable is set and I want to fall back through my switch/case statement to take the proper action for what the user selected.
I have tried the header statement like this header("Location: $_SERVER['PHP_SELF']"); this did not work, so I tried this header("Refresh: $_SERVER['PHP_SELF']"); this also did not work. I have also tried the <meta> tag and I was not successful with that either. So I am stuck on how to get this to work. Any help would be appreciated.
First I want to say that I am fairly new to PHP and Web Developement. I have created web pages before, but not entire sites. So I am in a position now were I need to develope a web site. I chose to go with PHP because of it's flexability and similarity to other languages. Also, as a side note, I am not familar with all of the HTML tags. So yes I may have jumped in some deep water. But I know how to swim and there are plenty of floatation devices on the internet, also this is an opportunity to learn another skill to put under my belt and I am having fun with it.
Ok so here is my problem and maybe my design is wrong so if someone knows a different way please let me know.
I have a page called admin.php, so far all this page does is grab information from a database (MySQL) and displays it in a table. At the bottom of the table there is a text box, two radio buttons, and a submit button. In the textbox the user enters the number of the item to be edited or deleted, depending on which radio button is selected. Edit is selected by default.
When the submit button is clicked the admin page calls up the edit.php page. This page has a switch/case statement with a few functions. The default of the switch/case statement is a call to the init function which initializes the variables with the selection the the user made from the database.
Now what I want to do is, after the init function is called is to refresh the browser. My flag variable is set and I want to fall back through my switch/case statement to take the proper action for what the user selected.
I have tried the header statement like this header("Location: $_SERVER['PHP_SELF']"); this did not work, so I tried this header("Refresh: $_SERVER['PHP_SELF']"); this also did not work. I have also tried the <meta> tag and I was not successful with that either. So I am stuck on how to get this to work. Any help would be appreciated.