Jump to content

pwesthead

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

pwesthead's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi i have a shopping cart where i get the products from mysq,l the problem is whatever item i add to my cart it only add the last entry from the database here is my code <form method="post" action="" class="jcart"> <fieldset> <input type="hidden" name="my-item-id" value="<?php echo $all['id'];?>" /> <input type="hidden" name="my-item-name" value="<?php echo $all['title'];?>" /> <input type="hidden" name="my-item-price" value="<?php echo $all['sale_price'];?>" /> <input type="hidden" name="my-item-qty" value="1" size="3" /> <!--product item--> <?php //retrive categories from the categories table $allitems=mysql_query("SELECT * FROM dg_products ") or die("There are no records to display ... \n" . mysql_error()); ?> <?php while ($all=mysql_fetch_array($allitems)) { ?> <div class="product_item"> <figure class="r_corners photoframe shadow relative hit animate_ftb long"> <!--product preview--> <a href="#" class="d_block relative pp_wrap"> <!--hot product--> <span class="hot_stripe"><img src="images/hot_product.png" alt=""></span> <img src="/keiths/<?php echo $all['image'];?>" class="tr_all_hover" alt=""> <span data-popup="#<?php echo $all['id']?>" class="button_type_5 box_s_none color_light r_corners tr_all_hover d_xs_none">Quick View</span> </a> <!--description and price of product--> <figcaption> <h5 class="m_bottom_10"><a href="#" class="color_dark"><?php echo $all['title'];?> </a></h5> <div class="clearfix"> <p class="scheme_color f_left f_size_large m_bottom_15"><s>&pound<?php echo $all['price'];?></s> &pound<?php echo $all['sale_price'];?></p> <input type="submit"class="button_type_4 bg_scheme_color r_corners tr_all_hover color_light f_left mw_0" name="my-add-button" value="add to cart" /></form>
  2. Ha Ha so easy when you know how thanks paul
  3. I have a dropdown list in a html form, i get the info for the dropdown list from mysql database using php, the problem is when i choose a name from the drop downlist and echo the name out i only get half the name if there is a gap in the name, eg if i get a name bart simpson it will only output bart and not show the last name, its something to do with the space in the name. here is the code. <form action='<?php echo $_SERVER['PHP_SELF']?>' method=post> <select name='charity_name' id="charity_name"> <option <?php //loop through categories table rows while ($row=mysql_fetch_array($charity)){ echo "<option value=$row[charity_name]>$row[charity_name]"; } ?></option> </select> <input type=submit value="Go"> </form> <? $charity_name=$_POST['charity_name']; ?> <?php echo $charity_name;?> thanks paul
  4. Hi thanks for the reply iv just sorted it out how to do this, cannot get the data from post but can get it from the database after iv posted the info. thanks paul
  5. Hi I want to post some data from my php file to a xml file how would i do this. here is my php file $result = mysql_query("insert into ".DB_BANNERS." set banner= '".$_FILES['file']['name']."',link= '".$link."',username= '".$username."',startdate= '".$startdate."',amount= '".$amount."',banner_id= '".$ID."'"); i want to post the name and link into a xml file thanks paul
  6. Hi can anyone see the problem with this language file, i want my index page to load in portuguese and not english i have set the default to portuguese but keeps loading the index page in english. here is my code. session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'pg'; } switch ($lang) { case 'pg': $lang_file = 'lang.pg.php'; break; case 'en': $lang_file = 'lang.en.php'; break; case 'fr': $lang_file = 'lang.fr.php'; break; case 'de': $lang_file = 'lang.de.php'; break; default: $lang_file = 'lang.pg.php'; break; } include_once 'languages/'.$lang_file;
  7. Hi no it does not work if i use this works fine but as soon as i add the avatar bit no joy $body .= '<b><font color="#006699"> ' . $user_name . ': <font color="#000000"> ' . $chat_body . '</font> <br />';
  8. Hi thanks for your reply tried that code too no joy blank screen, the image directory is correct, this has got me pulling my hair out thought this would be easy but apparently not? thankspaul
  9. Hi i tried the code you put but just get a blank screen, iv tried eveything but no joy
  10. Hi i have a chat written in php and as3 at the moment the chat window shows username and message but i want to add a avatar before the username. here is the code i have. $sql = mysql_query("SELECT * FROM chat75 ORDER BY date_time ASC"); while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $user_name = $row["user_name"]; $chat_body = $row["chat_body"]; $num = $row["avatar"]; $date_time = $row["date_time"]; $chat_body = stripslashes($chat_body); $chat_body = eregi_replace("&#39;", "'", $chat_body); $string =array(); $files = glob("../images/avs/*.*"); for ($i=1; $i<count($files); $i++) { $num = $files[$i]; } $body .= '<b><font color="#006699">' . $num . ': ' . $user_name . ': <font color="#000000"> ' . $chat_body . '</font> <br />'; } this is what i get in the chat window ../images/avs/avatar9.png: demo123: testing message i have tried everything to get the avatar to appear in the chat window but keep getting the above,i have tried to put echo in front but then just get a blank chat window. please help thanks
×
×
  • 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.