Jump to content

quick questions with php


abcdabcd

Recommended Posts

I hope nobody is going to get upset over these questions, I don't know anything about php a website designer built this site and I'm having to make minor modifications.

 

I have an "error" page if somebody doesn't enter a promo code on the site.  Right now it just says, "Please enter your promo code." on the left side.  I want to change the font and center it and/or upload an image.  I did some searching online and saw that it's the same code as html which I tried but then I got an error on line 1.  I'll paste both codes the top one is the original code and 2nd one is the code I tried to modify to insert an image.

 

original code:

 

<? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code."); } else { header("Location: http://xxxxx.com/xxxx?sub=$promoform"); } ?>

 

modified code that I tried:

 

<? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code.") <img src="http://www.xxxx.net/images/cellphone_2_01.jpg" height="122" width="160" align="middle" border="0" /> ; } else { header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); } ?>

 

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/96468-quick-questions-with-php/
Share on other sites

sorry it seems the forum code is removing it

 

 

<? $promoform = $_POST['promoform']; if($promoform == ""){ die("Please enter your promo code.") <img src="hxxp://www.xxxx.net/images/xxxxx_2_01.jpg" height="122" width="160" align="middle" border="0" /> ; } else { header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); } ?>

Try this:

 

$promoform = $_POST['promoform'];
if($promoform == "")
{ die("Please enter your promo code.")
echo '<img src="hxxp://www.xxxx.net/images/xxxxx_2_01.jpg" height="122" width="160" align="middle" border="0" />';
} 
else
{
header("Location: http://x.azjmp.com/0jn8z?sub=$promoform"); 
}

If the image is to be output in the 'die' statement then it needs to be in the quoted/bracketed part.

 

I.e.: die("Please enter your promo code. <img src='hxxp://www.xxxx.net/images/xxxxx_2_01.jpg' height='122' width='160' align='middle' border='0' />"); 

 

Note thet all of the quotes in the image tag need to be single quotes.

 

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.