Jump to content

Archived

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

opel

Help with if statement

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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.