opel Posted October 8, 2006 Share Posted October 8, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/23368-help-with-if-statement/ Share on other sites More sharing options...
.josh Posted October 8, 2006 Share Posted October 8, 2006 so you have a page that updates your db and then after it updates your db, you redirect it to another page, and you wish to echo out your 'success' message if the query was successful in the previous page? Quote Link to comment https://forums.phpfreaks.com/topic/23368-help-with-if-statement/#findComment-105944 Share on other sites More sharing options...
opel Posted October 10, 2006 Author Share Posted October 10, 2006 yes exactly, I am using Dreamweaver and it only lets you redirect a page. I would like to echo a success statement based on the update being true.Sorry never replied sooner never got a notifcation from the forum to my email. Quote Link to comment https://forums.phpfreaks.com/topic/23368-help-with-if-statement/#findComment-106865 Share on other sites More sharing options...
HuggieBear Posted October 10, 2006 Share Posted October 10, 2006 I'm assuming that you're passing true if successful and false if notaddlink.php needs the following at the top...[code]<?phpif ($_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]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/23368-help-with-if-statement/#findComment-106909 Share on other sites More sharing options...
opel Posted October 10, 2006 Author Share Posted October 10, 2006 thanks for your help ;D Quote Link to comment https://forums.phpfreaks.com/topic/23368-help-with-if-statement/#findComment-107111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.