Jump to content

Help with if statement


opel

Recommended Posts

I have set up a page redirect from an insert from which has "addpage.php?update=true"

I am trying to create an if statement to put on the addpage.php that will echo a statement to let users know the transaction worked.

I have tried to start the statement but it doesnt seem to work, can anyone help?

[code]<?php if header("Location: addlink.php?update=true") echo "Your article has been submitted"; ?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/23368-help-with-if-statement/
Share on other sites

I'm assuming that you're passing true if successful and false if not

addlink.php needs the following at the top...

[code]<?php
if ($_GET['update'] == "true"){
  echo "Your update was successful\n";
}
else if ($_GET['update'] == "false"){
  echo "There was an error inserting your record\n";
}
else {
  echo "You did not submit a valid update option\n";
}
?>[/code]

Regards
Huggie

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.