close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

thankyou.php redirect header

Thread began 7/21/2010 10:28 pm by bbg5101409933 | Last modified 7/22/2010 11:50 am by Jason Byrnes | 1520 views | 7 replies |

bbg5101409933

thankyou.php redirect header

What is the purpose of redirecting to the thank you page only if "index.php" is not blank?

In other words, in "contactus.php", within the following code:

//Send Mail All Entries
if ("index.php"!="") {
header("Location: thankyou.php");
}

what is the purpose of

if("index.php"!="")

?

This is the only part of the code that's given me trouble, so I'm trying to better understand the significance of basing the redirect on a page that doesn't exist ("index.php").

Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

it is only a string comparison used to determine if the header function should be used at all.
This is code generated by the Universal Email extension.


In the extension you could leave the redirect blank. if you do, that code would be written as:
//Send Mail All Entries
if ("" !="") {
header("Location: ");
}

If the if statement where left out in this case, it would generate an error due to the missing parameter in the header function.

Sign in to reply to this post

bbg5101409933

That makes sense. The only part I don't understand is why the "if" statement is checking against a file ("index.php") that doesn't exist. Does this file exist in the Universal Email extension?

Sign in to reply to this post

Jason ByrnesWebAssist

it's not checking the file. it's checking the string.

the if statement could be
if("dog" != "")

or:
if("dog" != "cat")


it's string comparison, that just happens to use the string "index.php".

it's not checking for the existence of the file, just that the first string ("index.php") is not the same as the second string ("")

Sign in to reply to this post

bbg5101409933

That clears it up. Thanks.

One last thing: What purpose does the string comparison serve? Why not just call the header alone?

I'm not doubting it's use. I'm just trying to understand it better.

Sign in to reply to this post

Jason ByrnesWebAssist

If the if statement where left out in this case, it would generate an error due to the missing parameter in the header function.

Sign in to reply to this post

bbg5101409933

Thanks for all your help!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...