If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Elementary if then else trouble

Hello,

Since I'm starting with PHP, I just can't figure out why this sequence does not work. It brings me a clean page with nothing in it.
I ran the script with echo on the "POST[uid']" and "POST['edupdel']" and both are received from the calling script.
All scripts

Note that since I'm working on localhost I do not need at this point the .. www...
Nevertheless your example will be used as a guide when I go into production.

Now, independently of my approach, I would really appreciate if you could lead me to the way where your example would work for me. I think that solving the issue the way I did does not make the one that is not working go away. I'd like to have both options. So, if you are up to it, with some infinite patience, it would interesting to find out why the Header("Location: does not work for me.

"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
This line reminds me of General Relativity and Quantum Mechanics when taken looking at Black Holes for the quantum perspective. The answers do not fit the way the World seems to work.

Sorry, I digress...

Going back to what is important. Thank You for your help. I tested your example and it would only show me the dreaded white (blank page). Not even the last echo shows up.

Now, independently of my approach, I would really appreciate if you could lead me to the way where your example would work for me. I think that solving the issue the way I did does not make the one that is not working go away. I'd like to have both options. So, if you are up to it, with some infinite patience, it would interesting to find out why the Header("Location: does not work for me.

If you get a blank page, first do a "view source" just in case something was returned but is interpreted by the browser as being all mark-up with no content.

Otherwise, if it's truly blank, that is usually a parse/compile error. When that happens, if your web server's PHP configuration has display_errors turned off, then nothing will be displayed. Therefore, in your development environment, it's useful to turn it on; or else put a tail on your php-errors.log file to see if it tells you what happened. (It's also useful to use a code editor that auto-detects parse errors, to at least let you find those before you actually try running it.)

However, my editor did not detect any parse errors when I copy/pasted your original code. It's possible it's "working" up to the point where the browser receives the Location HTTP header, but is unable to process it. I don't think it's required, but I always include a space after the "Location:". Also, if testing locally, you can still use a full URL:

PHP Code:

header("Location: http://localhost/file.php");

"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation