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
Share on other sites

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"); 
}

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.