Hey i am not completely new to php but i need a bit of help. I am trying to do a testing.php page. i want the page to handle errors for empty input boxes. Now i want it to do testing.php?error=1 then display the error message. I have tryed a few codes that did not work but maybe should. the first code i tryed was with switch statement like this. switch($error) { case 1: echo "Error Number 1"; break; case 2: echo "Error Number 2"; break; } now that code didnt work. so i tryed a simple if statement like this. if ($error == "1") { echo "Error Number 1"; } if ($error) == "2") { echo "Error Number 2"; } again didnt work when i type in testing.php?error=1 or testing.php?error=2 alll i get is a blank white page. can any one explain a bit on how this is done?
hi code is absolutely fine. but may b the problem is it's treating the $error as a varChar not Number so please update code in this way. $error=$_REQUEST['error']; switch($error) { case "1": echo "Error Number 1"; break; case "2": echo "Error Number 2"; break; } PHP:
Thank you i just tryed that code out and it worked. tell me can the same method be used when doing a if statement? it seems as if it can by just using request method.
i have 1 more question regarding this how do you get a page inside a page like the code you posted that helped now my page can do test.php?error=1 now what if i want my page to do like test.php?error=1&test=1 and that takes me to the test=1 page is that possible?
what do you mean include inside the if statements? so far i have $error=$request['error']; switch ($error) { case "1": echo "error 1"; break; case "2": echo "error 2"; break; } now i want to take this switch statement and make the test.php page go to test.php?error=1&e=2 now the ?error=1 part works but i cant seem to make the page work with e=2 it always gos back to the main page of the test.
Here is what i am trying to complete. i am making a php fusion type page for movie listing. Now when the user clicks a categorie for movies say Horror the page movielist.php will go to horror like movielist.php?state=Horror now that works but i want the horror page to only display 10 movies per page so that means the sub page Horror needs to have a &page=1 added on to it. so the link would be movielist.php?state=Horror&page=1 now state works that displays the movies but the &page=1 part does not work that just takes me back to the main movielist.php page. so my question now is how do i add a subpage on a subpage so that the &page=1 will work properly.
i can't understand what you want. if you uploaded your site then give me link i'll help you out regarding this issue
sure my site is demons-revenge.com/MovieList.php now thats my page so far. when you go to the url your notice that it has 4 categories Horror Comedy Action and Drama now when you click horror the horror movies display but what i want now is for that page to have a second page added on the url will be demons-revenge.com/MovieList.php?state=Horror and i want that horror page to have new pages on it so that the movies will show 10 per page.