Jump to content

monkeybidz

Members
  • Posts

    330
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.monkeybidz.com

Profile Information

  • Gender
    Not Telling

monkeybidz's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Any idea where I can get something close to it?
  2. I have not been here for a long time, but just recently my php5.ini and .htaccess file got deleted while trying to install a new script. I have shared linux hosting at godaddy, but I cannot seem to get the code required inside these two files that would be standard or basic. Does anyone have a sample code I can use on these two files? Thanks in advance!
  3. You are in the right direction, it displayed more results than before, but I now get this error: Parse error: syntax error, unexpected '<'
  4. I keep getting an error message on my site that points to this line of code. It is from OSCommerece. Can someone help me clean this line up a bit. Just does not look right to me. I played with it a bit and I get some good results, just not 100Y%. eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');"); Thanks in advance!
  5. Ok, with a bit of info from all you guys, It is now resolved. I went with a full delete and new insert. This was required as the person that updates the record will now be assigned to be the person that edited the post. Only the id, price1, price2 and date are really changed by the user. The rest of the vars are echoed on a form and are not editable by the user. Here is what I went with.: if($user_id !="" && $name !="" && $update=="yes"){ $query = "DELETE FROM prices WHERE id='$id'"; mysql_query($query); echo mysql_error(); $resultado = "You successfully updated this posting!<br>Thank you for participating."; $insert=mysql_query("INSERT INTO prices VALUES ('', '$user_id', '$name', '$bus_type', '$street', '$city', '$state', '$zip_code', '$brand', '$quantity', '$price1', '$price2', now())"); } Thanks a bunch people.
  6. Niether of the above worked. Not sure what you mean by debugging.
  7. I tried this, but nothing: mysql_query("UPDATE prices SET price1='".$price1."', price2='".$price2."', date='".$date."' WHERE id='".$id."' "); Would I have to declare each value or just the ones I need updated?
  8. Well, it is to update the prices and it has to display the date it was updated. I just noticed that it is not deleting anything at all, it is just creating a new row with all the information and new date. I tried changing it to this: if($user_id !="" && $name !="" && $update=="yes"){ mysql_query("DELETE id, user_id, name, bus_type, street, city, state, zip_code, brand, quantity, price1, price2, date FROM prices WHERE id='".$id."'"); $resultado = "You successfully updated this posting!<br>Thank you for participating."; $date=getdate(); $insert=mysql_query("INSERT INTO prices VALUES ('', '$user_id', '$name', '$bus_type', '$street', '$city', '$state', '$zip_code', '$brand', '$quantity', '$price1', '$price2', now())"); } I get the same result. How would I make it to just update the row instead of deleting?
  9. I have this code to update mysql db. It deletes and updates everything in the row except for the date. The date remains the same. In my db i have it under "prices" and it is named "date". Here is the code I am using. if($user_id !="" && $name !="" && $update=="yes"){ mysql_query("DELETE FROM prices WHERE id='".$_POST['id']."'"); $resultado = "You successfully updated this posting!<br>Thank you for participating."; $date=getdate(); $insert=mysql_query("INSERT INTO prices VALUES ('', '$user_id', '$name', '$bus_type', '$street', '$city', '$state', '$zip_code', '$brand', '$quantity', '$price1', '$price2', now())"); }
  10. Your code: $return = = htmlspecialchars_decode(token_replace($output, 'node', $node), ENT_QUOTES); Try: $return = htmlspecialchars_decode(token_replace($output, 'node', $node), ENT_QUOTES);
  11. I am getting the row results from mysql as called, but they appear as a straight line instead of new table row when I echo like: echo "TABLETABLETABLETABLE"; I am looking for: echo "TABLE TABLE TABLE TABLE"; Here is my code: $brand = $_POST['brand']; $city = stripslashes($_POST['city']); $state = $_POST['state']; $zip_code = stripslashes($_POST['zip_code']); if($city !=""){ $query = "SELECT name, bus_type, street, city, state, zip_code, brand, quantity, price1, price2, date FROM `prices` WHERE city ='".$city."' AND state ='".$state."' AND brand = '".$brand."'"; }else{ $query = "SELECT name, bus_type, street, city, state, zip_code, brand, quantity, price1, price2, date FROM `prices` WHERE zip_code ='".$zip_code."'"; } $result = mysql_query($query); $count=mysql_num_rows($result); if($count==0 && $zip_code !=""){?> <td width="100%" class="style9">Sorry! There are no results for that city, state and brand.</td> <? }else{ while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ ?> <td width="100%" class="style9"><?php echo "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td{$typ_image}</td> <td><b><a href=\"\" title=\"{$row['street']} {$row['city']}, {$row['state']}. {$row['zip_code']}\" target=\"_blank\">{$row['name']}</a></b><br>Last Updated:{$row['date']}</td> <td><b>{$row['brand']} - {$row['quantity']}</b><br>Before Tax:\${$row['price1']} After Tax:\${$row['price2']}</td> <td{$pago}</td> </tr> </table><BR>"; ?></td> <?php } } ?></table> <p> </p> </td>
  12. Why not add to both tables the field "userid" to track what the user edited, deleted or posted. "userid" will be inserted to any changes to the tables and you can also later call any changes made by that user.
  13. Yeah, that was a typo. It's supposed to be login.php. I kind of narrowed down the problem and realized that the code I posted is working, just not passing the var because it sits inside another "if(". Here is the entire code which is suposed to follow the $referer and start a session if the $email checks out ok. if($_SERVER['HTTP_REFERER'] =="post_new.php"){ $referer = "post_new.php"; }elseif($_SERVER['HTTP_REFERER'] =="login.php"){ $referer = "logged_in.php"; } $email=$_POST['email']; $sql="SELECT * FROM users WHERE email='$email' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count == "1" && $referer != ""){ session_start(); $_SESSION['email'] = $email; header("Location: ".$referer." "); //I am not getting $referer here exit(); }
×
×
  • 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.