Jump to content

monkeybidz

Members
  • Posts

    330
  • Joined

  • Last visited

Everything posted by monkeybidz

  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(); }
  14. If the referer is from a certain page I need it to return there after login, but my problem is that the register page on my site returns a success mesage on the same page and there is a login link on the header. If the user clicks on login, they are returned to the register page.
  15. Yes, I know. I just shortened them for posting here. It will only go to http://www.mysite.com/logged_in.php regardless of the referer page or site. Am I using the ELSE statement incorrectly?
  16. Im working on an issue that keeps sending the user to logge_in.php and never to post_new.php even if it is the referer. Here is the code I have wrote so far: if($_SERVER['HTTP_REFERER'] =="post_new.php"){ $referer = "post_new.php"; }elseif($_SERVER['HTTP_REFERER'] =="logged_in.php"){ $referer = "logged_in.php"; } header("Location: ".$referer." "); exit(); } Thanks in advance!
  17. Awsome! I was missing session_start(); on landing page. Thanks!
  18. See if adding this line helps. register_globals = on
  19. I am having trouble calling the session var "email" from the landing page. Here is the code that I am using. I am not even sure the session "email" is starting or registering. $referer = $_SERVER['HTTP_REFERER']; $email = $_POST['email']; $sql="SELECT * FROM users WHERE email='$email' "; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $email, table row count must be 1 row if($count==1){ // Session Register email session_start(); $_SESSION['email'] = $email; header("location:".$referer2." "); exit(); }
  20. Thanks. The browsers would be an issue for me if such code was available.
  21. Is there a way to get my visitors PC or Device Name? I am not looking for server name or ip. I need to get my current visitors computer name. Example: MAIN, HOME, OFFICE, TOM32154}}{|\] like when first naming a PC with a new windows install.
  22. Thanks Scootstah! The email comes from a form POST and echo's fine. I will give your code a try.
×
×
  • 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.