Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6724611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:42:37+00:00 2026-05-26T09:42:37+00:00

I have a small script that defines a variable called $prPrice . This script

  • 0

I have a small script that defines a variable called $prPrice. This script is not working in the way that I intend, as in some of the products that contain a certain department code are display prices relating to other department codes. So i assume that the way i have initially put this together is somehow wrong.

My question would be this, can anyone spot a problem with, or provide suggestions for bettering the following simple php script:

// Cost plus 2.5%
if ($prDept = (204 || 205 || 209 || 1501 || 1601 )) {
    if ($_SESSION['tax'] == "on" || !isset($_SESSION['tax']))
        $prPrice = ((($prCost1 / 1.14) * 1.025) * 1.14);
    else if ($_SESSION['tax'] == "off" && $prTaxable == "1")
        $prPrice = ($prCost1 * 1.025);
    else if ($_SESSION['tax'] == "off" && $prTaxable == "0")
        $prPrice = (($prCost1 / 1.14) * 1.025);

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:42:37+00:00Added an answer on May 26, 2026 at 9:42 am
    $prDept = (204 || 205 || 209 || 1501 || 1601)
    

    That is not how this works in PHP. It really needs to look like…

    $prDept == 204 || $prDept == 205 || $prDept == 209 || $prDept == 1501 || $prDept == 1601
    

    or alternatively,

    in_array($prDept, array(204, 205, 209, 1501, 1601))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this small jquery script that does not work if I remove the
I have this small script that shows a caption for a img when it
I have a small awk script that does some in-place file modifications (to a
I have a small script that I am try to port to work for
I have a small cgi script that fetches and validates a configuration file for
I have a script that animates a small DIV popping up on the page.
I have this small PHP script: <?php session_start(); $var = array(); $var['key'] = 'Var
I have a small script that moves the frame head backwards and forwards depending
I have a small script that copies files to a list of remote machines.
I have a small bash script that greps/awk paragraph by using a keyword. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.