Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. I don't see anywhere where you delete files unlink() Be careful with this so you don't delete files accidentally. so something like this if(isset($_GET['filenames'])){ foreach($_GET['filenames'] as $del){ unlink($dir."/".$del); } } This is the simple explanation, you are gonna want to do a pile of checking and changes before allowing a delete coming from the browser
  2. Your question is not that specific. You can edit the plugin directly and save it's modified version, but then you have to also edit any newer updates of the plugin as well. Another option is to include your own modifications as a plugin if said plugin is active. http://codex.wordpress.org/Function_Reference/is_plugin_active sooo....if WPSQT plugin is active.....include custom_WPSQT plugin for simplicity you can add functions into a certain theme within a functions.php file versus making a new plugin
  3. Still not a good host, hard to find good ones, but this has to be an apache issue and apache not responding. Most likely is the amount of incoming traffic. Could be amount of connections exceeded, respawning child, not closing fast enough, ddos attacks, spammers View your apache error and access logs and try to narrow it down. On a sidenote, clear your browsers cache and cookies, it could have been an intermittent issue and still showing you old data.
  4. Sounds more like server hosting issues than your script.
  5. Then add this to the top of the page. <?php session_start(); if(!$_SESSION['loggedIn']){ header('Location: http://www.example.com/login.php');//take to login or registration page? die(); } ?>
  6. By checking the session if a user is logged in, if not do a header or even meta refresh redirect Header must be used before any output to the browser. if(!$_SESSION['logged_in']){ header('Location: http://www.example.com/'); die(); } or if(!$_SESSION['logged_in']){ echo "<meta http-equiv='refresh' content='0;http://www.example.com/' />"; echo die(); }
  7. Bots and humans alike beat captchas, many of the popular or poorly written ones are being bypassed. They use ocr or even humans to bypass, reuse a session id for capcha images Your best bet is using reCatpcha , although some manage to get past occasionally, google frequently changes it so they can't.
  8. Right off i see a mistake change this: if (mail ($to, $subject, $body, $from))) { to this: if (mail ($to, $subject, $body, $from)) { Besides that, obviously php is not parsing correctly, first make sure xampp is configured and working.
  9. I guess the first thing should do is add this to the top of your script error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); See if there are any errors. Next can explain how it's not working, what you are not seeing or expecting.
  10. With this you can set a max width or height and will be a pretty close scale <?php $max_size = 100; $size = getimagesize($images); $ratio = $size[0] / $size[1]; if ($ratio >= 1) { $width = $max_size; $height = round($max_size / $ratio); } else { $width = round($max_size * $ratio); $height = $max_size; } $images_orig = imagecreatefromjpeg($images); $photoX = ImagesX($images_orig); $photoY = ImagesY($images_orig); $images_fin = ImageCreateTrueColor($width, $height); ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width, $height, $photoX, $photoY); ImageJPEG($images_fin, $new_images); imagedestroy($images_fin); //you should destroy at the end because will reside in memory ?>
  11. Did you paste a partial code? Should have an if here if(isset($_POST['getringan'])){ and also wrap it with another curly brace at the end
  12. Because someone can use curl and do a POST or make their own form and direct it to your script. Protect and check your incoming data on the receiving script itself, then it doesn't matter where it comes from. Be sure is data you expect, filter/sanitize/escape anything before you use it.
  13. <?php function index() { chart($_POST['userinput']); } ?>
  14. But as ginerjm stated...is very old and should be redone. Consider doing it in html5 http://www.html-5-tutorial.com/
  15. It could be case sensitive on your column names While($row = mysql_fetch_assoc($records)){ echo "<tr>"; echo "<td>".$row['Number']."</td>"; echo "<td>".$row['Depth']."</td>"; echo "</tr>"; }//end while
  16. Sounds like you are wanting pagination or to limit the results. Here is an older pagination tutorial that uses the deprecated mysql_* functions http://www.phpfreaks.com/tutorial/basic-pagination If you just need to limit some results can add this to the end of the query shows one result LIMIT 1 starting row zero and show one result LIMIT 0,1 starting row zero and show five results LIMIT 0,5 starting row ten and show ten results LIMIT 10,10
  17. An old pagination tutorial for your old code. http://www.phpfreaks.com/tutorial/basic-pagination
  18. That's fine, you can also select the table, click operations and change the storage engine to myisam.
  19. Or this odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};
  20. You may need to use the 32 bit version of wamp
  21. Can't you just add an additional wp_mail() call there? <?php if (get_post_meta( $post->ID, '_listing_contact_form', true) != '') { echo do_shortcode(get_post_meta( $post->ID, '_listing_contact_form', true) ); } else { $nameError = ''; $emailError = ''; if(isset($_POST['submitted'])) { $url = get_permalink(); $listing = get_the_title(); if(trim($_POST['contactName']) === '') { $nameError = 'Please enter your name.'; $hasError = true; } else { $name = trim($_POST['contactName']); } if(trim($_POST['email']) === '') { $emailError = 'Please enter your email address.'; $hasError = true; } else if (!preg_match("/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$/i", trim($_POST['email']))) { $emailError = 'You entered an invalid email address.'; $hasError = true; } else { $email = trim($_POST['email']); } $phone = trim($_POST['phone']); if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } if(!isset($hasError)) { $emailTo = get_the_author_meta( 'user_email', $post->post_author ); if (!isset($emailTo) || ($emailTo == '') ){ $emailTo = get_option('admin_email'); } $subject = 'Listing Inquiry from '.$name; $body = "Name: $name \n\nEmail: $email \n\nPhone: $phone \n\nListing: $listing \n\nURL: $url \n\nComments: $comments"; $headers = 'From: '.$name.' <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email; wp_mail($emailTo, $subject, $body, $headers); wp_mail('help@dealfiles.com', $subject, $body, $headers); $emailSent = true; } } ?>
  22. I guess you can write or save the data with js. Try adding the meta using something like opengraph to the head of the page http://ogp.me/
  23. You can do the multiple echo with one also eliminating the need to keep breaking in and out of php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form enctype="multipart/form-data"> <?php include 'connect.php'; $dir = '/images/advisory'; $res = mysql_query("Select * from image_advisory INNER JOIN main_advisory ON image_advisory.advisory_id = main_advisory.id "); echo "<table border='1px'>"; while ($row = mysql_fetch_array($res)) { echo "<tr>"; echo "<td>" . $row['advisory'] . "</td>"; echo "<td><img src='" . $dir . "/" . $row['ad_img'] . "' height='100' width ='100' ></td>"; echo "</tr>"; } echo "</table>"; ?> </form> </body> </html>
  24. Not sure if you want to add this to send or upon recieving. if (isset($_GET['region']) && ctype_digit($_GET['region'])) { $region = $_GET['region']; } else { $region = 1; } $params = array( 'region' => $region ); Or just grab the request and insert using whichever method you use, GET,POST,REQUEST Cleaning and checking them before using them. $client->call('function1', ($_GET));
  25. Encoding is messy and sometimes difficult. You first need to detect the encoding and iconv doesn't do that. mb_detect_encoding() It's possible to use the header of the file info or a pages charset info, but is not always accurate or mixed encodings. This person made an always utf-8 class that could help. It could also fix garbled utf-8 https://github.com/neitanod/forceutf8 Even if you want to encode it to something else...at least it should be utf-8 to start with.
×
×
  • 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.