TurboTax Software - Loans - Debt - Home Insurance - Ringtone

PDA

View Full Version : ["PHP_SELF"] help!


vivido
Jan 2nd 2008, 7:30 am
I am using the following to show up the thank you message in my contact us form.

I need to show up a separate thankyou.html page. What should I define for that in the code?

Thank you.

vivido



if(isset($_POST["commit"]))

{?>

Thank you for contacting us. We will revert back to you soon.

<? }?>

<form action="<? print $_SERVER["PHP_SELF"] ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">

goliathus
Jan 2nd 2008, 8:04 am
<?php
if(isset($_POST["commit"]))
{
include "thankyou.html";
}
?>

<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">


just a tip: Use <?php instead of <? ... some PHP servers needs it ... And also echo is better than print :)

papa_face
Jan 2nd 2008, 9:30 am
<?php
if(isset($_POST["commit"]))
{
include"thankyou.html";
}
?>

<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">


just a tip: Use <?php instead of <? ... some PHP servers needs it ... And also echo is better than print :)

Your code won't work. Mine will though:
<?php
if(isset($_POST["commit"]))
{
include("thankyou.html");
}
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">

goliathus
Jan 2nd 2008, 10:05 am
Your code won't work. Mine will though...

WTF? include "thankyou.html"; works the as well as include("thankyou.html"); .... you should try it before you post this comment ...

MMJ
Jan 2nd 2008, 10:20 am
Your code won't work. Mine will though:
<?php
if(isset($_POST["commit"]))
{
include("thankyou.html");
}
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">
And why is that?

@OP:
You should use $_SERVER['SCRIPT_NAME'] instead of $_SERVER['PHP_SELF'] because $_SERVER['PHP_SELF'] is liable to XSS.

papa_face
Jan 2nd 2008, 3:26 pm
Erm excuse me!<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">

Which will produce an unexpected error because of your quotes. It is you that should try it before you comment!

MMJ
Jan 3rd 2008, 5:01 am
Erm excuse me!<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" enctype="multipart/form-data" name="FeedbackForm" id="two">

Which will produce an unexpected error because of your quotes. It is you that should try it before you comment!
Ouch, this is a bit embarrassing for you.

No comment.

LittleJonSupportSite
Jan 3rd 2008, 6:36 am
Some people should really think and then read what they type and more importantly test their own code before posting.

tut tut tut.

papa_face
Jan 3rd 2008, 6:49 am
Ouch, this is a bit embarrassing for you.

No comment.
Some people should really think and then read what they type and more importantly test their own code before posting.

tut tut tut.

lmao sorry, I have no idea why I thought it would produce an error :confused::confused::confused:
Oh well, everyone makes mistakes lol.

LittleJonSupportSite
Jan 3rd 2008, 8:20 am
lmao sorry, I have no idea why I thought it would produce an error :confused::confused::confused:
Oh well, everyone makes mistakes lol.


Exactly. Everyone makes them then reads the error logs and fixes them right!

Now if there was only an error log for "life"

Hmmmm

Next project....