Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. I don't know what you mean by bulk ! if you mean many different queries at once then MySQLI could do it, Looking back on your code the one thing i would suggest is you echo the query on the success, as i believe your WHERE email='{$_SESSION['email']}' would become WHERE email='' as i seen no session_start(); in your script
  2. You could use cookies, heres a basic example (i tried to keep it simple) i hope you get the idea replace $i = rand(0, count($images)-1); with if(!empty($_COOKIE['ad_image'])) { $_COOKIE['ad_image']++; if($_COOKIE['ad_image'] > count($images)) $_COOKIE['ad_image']=0; }else{ $_COOKIE['ad_image'] = 0; } $i = $_COOKIE['ad_image'];
  3. add limit to 5 $sql = "SELECT * FROM Products ORDER BY ProductDateAdded DESC LIMIT 0,5";
  4. replace die ("error editing information"); with die (mysql_error()); and define what you mean by
  5. It depends on all of the conditions but you could probably use a RegEx, I think you mean you have 3 blocks which you need to replace a value BUT ONLY know the value of the first one. i guess you could try something like this <?php $HTML = "<tr><td nowrap=\"1\" width=\"33%\"> QWE1 </td> <td nowrap=\"1\" width=\"33%\"> KSJDWS </td> <td nowrap=\"1\" width=\"33%\"> SDKSJWN </td> </tr>"; $find = 'QWE1'; $replace = 'ABC'; $HTML = preg_replace('/(<[^<]*?)'.$find.'(.*?\1)[^<]*(.*?\1)[^<]*(<)/sim', '\1'.$replace.'\2'.$replace.'\3'.$replace.'\4', $HTML); echo $HTML; ?>
  6. No that won't work, your need to send the Header data, use cURL's CURLOPT_USERAGENT curl_setopt($curl, CURLOPT_USERAGENT, '<script>alert(\'PHP Freaks Rule\')</script>'); If you are using any of the header info then you need to filter it first, if not then don't worry
  7. they are just too lazy to do this instead <?php include('inc.submembers.php'); echo "</td></tr>"; } ?>
  8. update the form then ie <input type="text" name="Name" value="<?php echo "whatever"; ?>" />
  9. What part don't use understand ? Lets just say you have a Javascript or PHP use grabs the User-Agent and echo's that to the page Now the problem is, User-Agent comes from the browser BUT it should NOT be trusted, as it can be changed to anything, for example, echo $_SERVER['HTTP_USER_AGENT']; may output Nothing wrong with that.. BUT if I changed my User-Agent to <script>alert('PHP Freaks Rule');</script> I'll get an alert, this is the basis behind injections, its only a problem when coders don't filter the untrusted data, and some coders think that $_SERVER['anything'] is safe! and they find out the hard way.
  10. theirs a few ways, here's a simple one $x = pathinfo('abcde.jpg'); echo $x['filename']; //echo $x['extension']; //if you wanted the jpg
  11. Just use Limit select * from `blueprint_items` where `id`=? LIMIT 0,1 Again LIMIT 0,1 Moving to correct section (being an SQL problem)
  12. if you searched WHERE usernames LIKE '%madtechie%' OR subjects LIKE '%' it finds every subject as subjects LIKE '%' means any subject so the username part is kinda pointless I'll also like to point out you shouldn't have the @ on the query as it omit errors (which during development you want to see) if you update to $resultsearch = mysql_query ( $querysearch ) or die($querysearch.mysql_error()); your get a better error report for debugging
  13. Well the function does echo's data! the reason your getting all the records is because if $serialsearcher is empty then you are querying the following:~ serialnumber LIKE '%' which means any! add $serialsearcher to the function parameters and try something like this (rough draft) $q =""; if(!empty($serialsearcher)) $q .= "serialnumber LIKE '%$serialsearcher'"; if(!empty($search)) { if(!empty($q)) $q .= " OR "; $q .= "name LIKE '%$search%'"; } $querysearch = ("SELECT * FROM parts WHERE $q ");
  14. header info should be valid, What doesn't work?
  15. Is this solved? If so please click topic solved bottom left
  16. remove the $notice_text from your code and add the text directly into the plain text $plain_text = "$first_name,\n\n" . "IF YOU CANNOT READ THIS EMAIL FOLLOW THIS LINK: www.mysite.com/repairstatus.html\n". "Thank you for stopping by Luggage Shop. This emails contains information about your recent repair\n\n" .
  17. add or die(mysql_error()); $value = mysql_query("SELECT name FROM idlers WHERE name='".mysql_real_escape_string($name)."' LIMIT 1") or die(mysql_error());
  18. Your need to post more complete code,
  19. of course but i would only use it for output, $para = $_POST['elementName']; in truth i would use CSS
  20. Sorry it was 7am and i had no sleep, i assume the problem was t.name = cl.id
  21. The get has nothing to do with the field names if your passing ID via get then i would guess that your code would look like this $id = $ibforums->input['ID']; //updated $DB->query("SELECT cl.*, t.desktop AS to_desktop from ibf_faq AS cl INNER JOIN ibf_members AS t ON t.name = cl.id WHERE cl.id='$id'"); //updated
  22. (I just noticed the as cl) try WHERE cl.id='$id'
  23. Okay put it this way ibf_faq has a field called ID ibf_members has a field called ID and your saying WHERE ID='$id' What ID are you trying to use ? the ID from ibf_faq or ibf_members? I'll guess and say ibf_faq, so change WHERE ID='$id' to WHERE ibf_faq.ID='$id'
  24. try this *untested* $data = " the quick red fox jumped over the lazy dog "; $data = trim(preg_replace('/(\s)(\1+)/im', '\1', $data)); echo $data;
×
×
  • 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.