Current location: Hot Scripts Forums » Programming Languages » PHP » Small but urgent help needed


Small but urgent help needed

Reply
  #1 (permalink)  
Old 10-04-05, 05:23 AM
GemiLinge GemiLinge is offline
New Member
 
Join Date: Oct 2005
Location: London UK
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Small but urgent help needed

Hi,
can anyone help me out. I am trying to set my shopping to display certain messages when the cart value has been reached.

The code i have at the moment is a shown:-

<?
if ($final_amount_total >= 0.00 & $final_amount_toal <= 30.00) {
echo "The Value is is between 0 and 30";
} elseif ($final_amount_total >= 0.00) {
echo "The value is greater then 30";
}
?>

The problem is that it does not display any message at all. Also i want it to recognise when it is greater than 30.00 so that it can show a link, and a message when it is less than 30.00.

Any help would be great as we were supposed to be open yesterday but have this small problem in the shopping cart.
Reply With Quote
  #2 (permalink)  
Old 10-04-05, 05:34 AM
pinguïn pinguïn is offline
New Member
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
[QUOTE=GemiLinge]
PHP Code:

<?php

if ($final_amount_total >= 0.00  $final_amount_toal <= 30.00) {
echo 
"The Value is is between 0 and 30";
} elseif (
$final_amount_total >= 0.00) { 
echo 
"The value is greater then 30";
    }
?>
try using && instead in your first If-statement
Reply With Quote
  #3 (permalink)  
Old 10-04-05, 05:40 AM
GemiLinge GemiLinge is offline
New Member
 
Join Date: Oct 2005
Location: London UK
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
I have tried using && but only the first message appears when the value is low but the second message wont appear when it has reached that value or above.
Reply With Quote
  #4 (permalink)  
Old 10-04-05, 08:15 AM
Richard's Avatar
Richard Richard is offline
Wannabe Coder
 
Join Date: Sep 2005
Location: Oxford, UK
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Firstly you're missing a t in total, in the second part of the if statement. Also, you might want to try using $_GET to get variables from the URL (i'm assuming here though).
PHP Code:

    if (($_GET['$final_amount_total'] >= 0.00) && ($_GET['$final_amount_total'] <= 30.00)) {

        echo 
"The Value is between 0 and 30";
    } elseif (
$final_amount_total >= 0.00) {
        echo 
"The value is greater then 30";
    } 
If all else fails, try echo'ing the variable, to see if it is in fact the value you think it is

Last edited by Richard; 10-04-05 at 08:21 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: PHP Freelancer needed in Mumbai/Navi Mumbai keyman Job Offers & Assistance 3 06-07-06 09:20 AM
URGENT Needed a php/mysql programmer annie Job Offers & Assistance 3 11-15-04 10:29 AM
PHP coder needed for a small job - 100$ Kamejoko Job Offers & Assistance 2 10-02-04 11:00 AM
small image script needed. graham barnes Script Requests 0 06-18-04 03:06 AM
Needed ASP Programmer for a small work _ Urgent superprogrammer Job Offers & Assistance 1 02-16-04 04:40 PM


All times are GMT -5. The time now is 06:14 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.