Jump to content

Alexhoward

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

About Alexhoward

  • Birthday 12/12/1983

Contact Methods

  • Website URL
    http://www.addsomemusic.co.uk

Profile Information

  • Gender
    Male
  • Location
    Norwich UK

Alexhoward's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi Guys! i've fixed it, but in a round-about way... firstly i created a session for the product id when adding to the basket e.g. $_SESSION['id'.$product_id] ; i then loop through the products looking to see if the session for the product_id has been set. if not it's not in the basket. when emptying the basket i simple clear all session as i'm not holding any customer login info. Thanks for all the help, and i'm sure there's a better way, but this works! hope that all made sense, Thanks again!
  2. Hiya, I have added three products to the list: the shopping list contains product id and then quantity. i ripped this code off another site i made and so don't need quantity, but leaving it there shouldn't matter... should it...? :-\ print_r($_SESSION['sh']) ; Array ( [93] => 1 [94] => 1 [95] => 1 ) cheers!
  3. anyone....? i really have no idea what to do... I have finished all the work apart from this tiny bit.. please... Cheers
  4. I just can't get it to work..!! so i'm adding the items into $_SESSION['sh'] I'm then using a while loop to pull the products from the database so as it loops through each product i'm setting the ID to $prod_id i'd like to say something like: if(in_array($prod_id,$_SESSION['sh'])) { //take the button away..... } does anyone know how to do this...? Cheers
  5. hi. I have tried many variations of this method. When i use this it either just works on the last item added to the basket. or affects all of the items cross the entire site...? i'll try your version thou in case i was being a noob...!! Thanks
  6. Hi guys, thanks for the reply ok so i add/remove from the session using a link like: <a href="add_list.php?action=add&id='.$prod_id.'"><img src="images/list.jpg" border="0" alt="Add to Shopping List"></a> as the $prod_id is set before in the while loop pulling all the products. the add/remove code is: <?php session_start(); //add item to shopping list if ($action == "add") { $_SESSION['sh'][$product_id]++; } //remove item else if ($action == "remove") { $_SESSION['sh'][$product_id]--; } //empty baasket else if ($action = "empty") { unset($_SESSION['sh']) ; } //if zero clear if($_SESSION['sh'][$product_id] == 0) { unset($_SESSION['sh'][$product_id]) ; } ?> So what i need to do when pulling all the products, is see if the product ID is in the session. if it is then just leave out the add to basket button. Cheers
  7. Hi Guys, really stuck with this one and was hoping someone on here could help? been all over google and can't find the answer... I'm using a session to hold products id when added to the shopping basket. problem is i don't know how to tell if they have already been added. on the sales page of the website i loop through all the products in the database, pulling all the relevant details, as well as adding an add to cart button if the product has not been sold. this disapears if the product is sold. as they only sell single items i would also like to exclude the "add to basket" button when the item has been added. Therefore does anyone know a way of checking if the item is already in the session as i loop through to pull the products? hope that makes sense...! thanks in advance! As the site only sells single products
  8. Hi, thanks for the reply. Well... I'm actually pulling a bit of data. page title, description, keywords, etc... but i can't echo anything... it will just output as text
  9. i use: "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ; This will bring back everything in the address bar... is that what you're after...? ignore if not...
  10. Good evening! I've created a content mangement system for my website. This allows me to change all the text from the backend using a rich text editor. The code inserts the formatted text into a MySQL table with all the HTML tags, I then echo this on the front end. Problem is, on some pages i need to use data either posted from a form, or pulled from a different table. i.e. a name attached to the users login via email. so to pull out the content i'm using: simplfied... <?php $con = mysql_connect($host, $db, $pass) or die ("Apologies we are experiencing technical difficulties") ; mysql_select_db($db) or die ("Apologies we are experiencing technical difficulties") ; $query = mysql_query("SELECT * FROM table WHERE page = x") ; while($row = mysql_fetch_array($query, MYSQL_ASSOC)) { $content = $row['text'] ; } echo $content ; ?> however if i was echoing this manually i might put: <?php echo "Hello ".$full_name.", Welcome to my website..." ; ?> So my question is... is there a way to input variables into the rich text editor so that they display a result on the front end..? Thanks in advance!
  11. Hi, Thanks for the reply, It looks like i have to do a if they came from here go here kind of thing, isn't there just a header('Location: '.$_SERVER['REQUEST_URI']); sort of thing i can do...?
  12. can anyone help me out with this..?
  13. hi, yes i know how to do it manually, however, i'd like to do it with $_SERVER['HTTP_REFERER'], so they are directed back to where they cam from
  14. Hi Guys, wondering if anyone could help me out with this...? I have a member area (amongst others) that require login to access. thing is if you are not logged in it bounces you back to the login page when the user logs in i would then like to take them back to where they were trying to get to i'm using the header function but can't seem to get it to work with $_SERVER['HTTP_REFERER'] could anyone tell me if this is possible and if so how? Thanks in advance! Add Some Music http://www.addsomemusic.co.uk
  15. Alright guys, found a good one that works, had to replace the <br /> tags and stripslashes and remove rn but it works http://www.kevinroth.com/rte/demo.htm thanks again
×
×
  • 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.