Jump to content

barney0o0

Members
  • Posts

    103
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

barney0o0's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok, they are the same. cart.php has a link to delete rows from the session values with the url cart.php?xyz with the necessary values ( as in my initial post) to cross check and fire the delete.When I test using cart.php ( as apposed to /cart) it works fine. I don't know what is the correct method is to send to /cart ( which is directed to cart.php (self)) and fire the code to delete the session row ( in the original post)..
  2. Those values are created with the link. The script cross checks the values against the session values. The session script, if OK, then removes the row. As mentioned, the .php file works fine...I don't understand how I can reload the page with the del=1 condition with a seo friendly URL as apposed to the functioning .php file
  3. The only url parameter is the $lang, all the other data is pulled from the session.
  4. The full url is website.com/en/cart The content of the cart.php page is pulled down from both the session 'user' and 'cart' Its a little B2B site, which content is user protected, i know its not ideal, but this should've been a quick fixed thats melting my brain. The above script works fine when using the .php file In the htaccess rewrite file theres a simple 'RewriteRule ^([a-zA-Z_]+)/cart$ cart.php?lang=$1 [L,NC]
  5. HI, its a been a long afternoon....ive inherited partial site to update. Shopping cart works fine, however as ive updated the structure to SEO friendly urls one part isnt working I have a delete button, and script to update the session: <a href="cart.php?rid=x&del=1&pos=y" >delete </a> if($_GET['del']==1 && isset($_GET['rid']) && $_GET['rid']!='' && $_GET['rid']!=0) { $r=$_GET['rid']; $pos=$_GET['pos']; $_SESSION['qty']=$_SESSION['qty']-$_SESSION['cart'][$pos]['qty']; unset($_SESSION['cart'][$pos]); } when using the url cart.php?... all works fine, however, now with seo friendly link (the page is website.com/cart) the page refreshes however doesn't update the session. How do i reconstruct the delete url to reflect the changes on structure so that it works? Thanks in advance
  6. barney0o0

    CONCAT

    Ah, thanks...i didnt realise i could CONCAT 'after' the WHERE clause, hence thinking about aliases...many thanks
  7. barney0o0

    CONCAT

    Hi, im trying to create a query for search results. The results are formed from two tables that form the full product code (groups.code1.products.codeDX and groups.code1.products.codeSX). What i gave at the mo.. SELECT groups.grid, groups.code1, products.codeDX, products.CodeSX, products.prodid, products.groupid FROM groups LEFT JOIN products ON groups.grid = products.groupid (CONCAT STUFF) WHERE (op1 LIKE \"%$trimm%\" OR op2 LIKE \"%$trimm%\") GROUP BY groups.grid Is it possible to create a CONCAT alias 'after' the join, i.e. CONCAT (code1, ".", codeDX) AS op1 CONCAT (code1, ".", codeSX) AS op2 Its possible that people search for group.code1 (FRSC) or just the CodeSX/CodeDX (100674) or the full product code (FRSC.100674)...the results are then echo'd by groupid....any ideas, or am i looking at the solution from the wrong perspective. thanks in advance
  8. Thanks...so..... From an array perspective, would it be possible to create string based in id, i.e. $lang['2'] = 'Contatto'; echo $lang['2']; ..as i havent done one before, would the code by something like this? $array1 = array(); $result = mysql_query("SELECT langs.tex_".$lang.", langs.langid FROM langs"); while ($row = mysql_fetch_assoc($result)) { $lang=$row['tex_".$lang."']; $langs[] = $lang; }
  9. Hi, i have a db table in this structure: langid | tx_en | tx_it | tx_ru 1 welcome benvenuto Добро пожаловат 2 contact Contatto Контактная etc, etc After the initial query of 'SELECT tx_".$lang." FROM langs' , is it possible to echo via php these values, however id or record number based? Such as <?php echo $row_langs['tx_'.$lang] (WHERE langid = 2); ?> or <?php echo $row_langs['tx_'.$lang] (WHERE langid = 1); ?> ? Throughout pages i have 10 - 20 different keywords and phrases stored in the above table that need to be echo throughout page. Rather than making 20 queries (to retrieve specifc id's) per page, i thought just make one query and echo the data after....is this actually possible or should i rethink? Thanks in advance
  10. thanks....it was so obvious that i didn't see it
  11. HI Chaps, im losing sleep over this...with the below code, the info is been added to the database, however each record is added twice (with the same values)..i keep looking at it but cant see the problem...any ideas?..thanks in advance <?php if(isset($_POST['Submit'])) { $i=0; $ndim= $_POST["val3"]; foreach($_POST['idt'] as $idt) { $query = "INSERT INTO testdims (proid, dimid, dimvalue) VALUES ('$utid', '$idt', '$ndim[$i]')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); echo $query; $result_update = mysql_query($query); $i++; } } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> <?php $result = mysql_query("SELECT dims.dimid, dims.dimdesc, dimlinks.prodid, dimlinks.dimlink FROM dimlinks LEFT JOIN dims ON dimlinks.dimlink = dims.dimid WHERE dimlinks.prodid = '$utid'"); while($row=mysql_fetch_array($result)) { ?> <div class="field"> <label><?php echo $row['dimdesc']; ?></label> <input name="val3[]" value="" /> <input name="idt[]" type="hidden" value="<?php echo $row['dimid']; ?>" /> </div> <?php } ?>
  12. ah, ok it should be ' <?php do {' ...but anyways, the head melt is the mysql query..
  13. ?..arent they within the echo to repeat through all the records?
  14. Hi chaps, its been a while since i did some coding.... im stumped... I need to echo out all results in 'page' table. These 'pages' have thumb images pulled from another table 'images'. The page.img has the same value is as images.cid So for example, the ideal would be: <?php do { ?> page.title page.text images.cid (1), images.cid (2),images.cid (3) <!-- i need to echo all images with image.cid the same as page.img --> <?php } while ($row_query = mysql_fetch_assoc($query)); ?> How do i bring in all the images from images.cid with the same value as the actual page.img ?
  15. ok, thanks both of you for your help.....with reference to the magic quotes, i even contacted the host (twice) and they confirmed that everything was off.....ffs
×
×
  • 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.