promotion scrip

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jaross15
Forum Newbie
Posts: 2
Joined: Thu Jun 16, 2005 3:37 pm

promotion scrip

Post by jaross15 »

Code: Select all

<!-- Promotional Code -->
<font face=&quote;tahoma,arial&quote; size=&quote;2&quote;>
<table width=&quote;300&quote; border=&quote;0&quote; cellspacing=&quote;0&quote; cellpadding=&quote;0&quote;>
<tr><td colspan=&quote;2&quote; bgcolor=&quote;D98719&quote;>
    <table width=&quote;100%&quote; cellpading=&quote;0&quote;>
    <tr><td><b><font face=&quote;tahoma,arial&quote; size=&quote;4&quote; style=&quote;color:CDC9C9&quote;><font size=&quote;5&quote;>0</font> Promotional Code</font></b></td></tr>
    <tr><td colspan=&quote;2&quote; align=&quote;right&quote; bgcolor=&quote;FAE2E6&quote;>
    <table cellspacing=0 cellpadding=0><tr><td>
    <input type=&quote;text&quote; size=&quote;40&quote; name=&quote;pro&quote; value=&quote;<?php echo $pro;?>&quote;></td>

<?php
$dis = &quote;.10&quote;;
if($pro===&quote;LTWOU&quote;) {$pro = $dis&quote;;}
?>
I'm having trouble with the above script. I want it so that if the user enters LTWOU that It will give the user 10% discount. This script is part of my shopping cart so when i try to view my shopping cart its just a while screen.

Can anyone help?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Code: Select all

<?php
$dis = ".10";
if($pro==="LTWOU") {$pro = $dis";}
?>
Remove the " on the $pro = $dis;

Code: Select all

<?php
$dis = ".10";
if($pro==="LTWOU") {$pro = $dis;}
?>
jaross15
Forum Newbie
Posts: 2
Joined: Thu Jun 16, 2005 3:37 pm

Post by jaross15 »

Thanks, Cant beleive I missed that!
Post Reply