Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. You should be using POST, not GET. $rat = $_POST['rating'];
  2. I put the variable $db_var in there, so you could replace it with your database variable. <?php //connect to your database $query = "SELECT photo3 FROM employees WHERE (put condition here)"; $result = mysql_query($query)or die(mysql_error()); $row = mysql_fetch_assoc($result); if (!empty($row['photo3'])){ ?> <a href="images/<?php echo $_POST['photo3']; ?>" target="_blank"><img src="images/<?php echo $_POST['photo3']; ?>" alt="image" width="150" border="0" /></a> <?php } ?> ?> I'm not exactly sure what you are trying to do. If what I just did isn't what you want, then explain a little more.
  3. Thats not a smart idea to give out your information like that. Just post the relevant code your having trouble with.
  4. You have to have a password to get into the file.
  5. <?php if (!empty($db_var)){ ?> <a href="images/<?php echo $_POST['photo3']; ?>" target="_blank"><img src="images/<?php echo $_POST['photo3']; ?>" alt="image" width="150" border="0" /> <?php } ?>
  6. Well, you need to show your exact code. It should look like this: <?php $query = "INSERT INTO log (what, when) VALUES ('test', '1191020046')"; $result = mysql_query($query)or die(mysql_error()); ?>
  7. tomfmason, that is a great idea...I have never thought about that. I will definitely keep that in mind when I freelance from now on. I think every freelancer gets ripped off at least once, then they learn from it
  8. Well, we don't know what your files look like. So how are we supposed to know which file the links are kept in?
  9. Hah, I see the problem. You need to take this line out: $row_addorder = mysql_fetch_assoc($addorder); It should work fine after that.
  10. Well...first you need to check your database if that IP exists yet, and if it doesn't add it and show the image. <?php $ip = $_SERVER['REMOTE_ADDR']; $query = "SELECT col FROM ips WHERE ip='$ip'"; $result = mysql_query($query)or die(mysql_error()); if (mysql_num_rows($result) < 1){ //add IP to database //display image } ?>
  11. Your asking us a question that is impossible to answer without seeing any code.
  12. Hmm...I'm not sure what to tell you. I don't see a reason why the while loop would only go through one of the records if there are two. Could you post your updated code? I doubt that will show the answer, but I don't know where else to look.
  13. Go into phpmyadmin and put in this query: SELECT shop_tracker.shop_id, shop_tracker.card_qty, shop_tracker.item_total, card_items.card_name, card_items.card_sku, card_items.image, shop_tracker.card_id FROM shop_tracker LEFT JOIN card_items on shop_tracker.card_id = card_items.card_id WHERE session_id = '".$_COOKIE['PHPSESSID']."' Obviously your going to need to replace the cookie variable with something. I bet it only returns one result and you are just thinking it should return two. Double check it.
  14. It would be nice to know what the problem is...some code might help too.
  15. Well, you could make different pictures of different speeds, then do something like this. <?php switch ($speed) { case $speed < 10: $img = 'img1.jpg'; break; case $speed > 11 && $speed > 25: $img = 'img2.jpg'; break; case $speed > 26 && $speed > 50: $img = 'img3.jpg'; break; } echo "<img src='".$img."'>"; ?>
  16. You were close xP <?php if (isset($_GET['venue'])){ $location = $_GET['venue']; } else { $location = 'welcome'; } include 'location/'.$location.'.php'; ?>
  17. Change this: $query = "select * from ctboxes limit $offset, $limit" WHERE SHOW='YES' ; To $query = "select * from ctboxes WHERE show='yes' LIMIT $offset, $limit";
  18. This is a handy class http://htmlpurifier.org/
  19. Here, this will give you rows of 5 <?php $query = "SELECT * FROM images"; $target = mysql_query($query); // uses the query variable defined above. confirm_query($target); // calls to the function file. echo '<table>'; $counter = 1; while ($final_target = mysql_fetch_array($target)) { $submitter = "{$final_target["picsubmit"]}"; $description = "{$final_target["picdesc"]}"; if ($counter == 5) { echo '<tr>'; $counter = 0; } echo "<td><a href='{$final_target['picpath']}' target='blank'><img src='{$final_target['tnpath']}'></a>"; echo "<div align=\"left\">" . $description . "<br>" . "</div>"; echo "<br>" . "Submitted By: " . $submitter; echo "<h4>" . "<hr>" . "</h4>"; echo "</td>"; $counter++; } echo '</table>'; ?> Hopefully I'm not confused on what your wanting...
  20. Try this out <?php if (isset($_GET['venue'])){ $welcominclude = $_GET['venue']; } else { $welcomeinclude = 'welcome'; } include 'path/'.$welcomeinclude; ?>
  21. There is a post about how to format your database output, I'm trying to find it. I'm pretty sure it's a sticky on one of the boards. Hold on, I will post it here in a few minutes hopefully once I find it. EDIT Okay...I know it is somewhere on these boards, I can't seem to find it. It's titled somthing like "DB results into rows". Does anyone else know what I'm talking about? This is a pretty common question, so I see people referencing to that post a lot.
  22. You don't need to know how many rows will be inserted, the loop will take care of that for you no matter how many rows there are. Yes, if there are two columns, your going to need two variables from the database. I can't really help you much with that part as I don't know what your transferring over to the orders table...it shouldn't be hard to figure out though if you know what you want...
  23. So your basically just trying to transfer the items from the cart table in the DB to the order table of the db when they checkout? Then you will have to use a while loop. <?php while ($row_viewcart = mysql_fetch_assoc($viewcart)){ $query = "INSERT INTO orders (col1, col2) VALUES ('{$row_viewcart['val1']}', '{$row_viewcart['val1']}'": $result = mysql_query($query)or die(mysql_error()); } ?>
×
×
  • 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.