Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. Only display error if $user_password, $newpassword, or $repeatnewpassword are empty // check current password is empty if(trim($user_password) == '') { echo 'Please enter your current password'; } // check users new password is emtpty elseif(trim($newpassword) == '' || trim($repeatnewpassword) == '') { echo 'Please provide new password'; } // confirm new password matches elseif($newpassword != $repeatnewpassword) { echo 'New passwords do not match'; } else { // code for resetting password }
  2. What is run_query() has that been updated to use mysqli_query()? $result should now be the query result? If that is case then use $row = $mysqli->fetch_row(); $num_items = $row[0]; Or alternately $row = $mysqli->fetch_assoc(); $num_items = $row['num_items'];
  3. Your if statement could be rewritten as if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd']) || ($_SESSION['type']!="this" || $_SESSION['type']!="that")) { header("Location: /index.php"); } // Or as $allowedTypes = array('this', 'that'); if(!isset($_SESSION['usr']) || !isset($_SESSION['pswd']) || !in_array($_SESSION['type'], $allowedTypes)) { header("Location: /index.php"); }
  4. Change '~(<([uo]l)>.*</\\2>)~' to '~(<([uo]l)>.*</\\2>)~s'
  5. Find md5( replace with hash('sha512', lockout has not be defined in your session. Add if(!isset($_SESSION['lockout'])) $_SESSION['lockout'] = false; Before if ($_SESSION['lockout'] == true && (mktime() > $_SESSION['lastTime'] + 900)) You are using a constant which has not been defined. Either define it or remove it. Why are you adding html/Javascript to an email header? headers should be plain text. HTML/Javascript should be in the email body
  6. You need to use regex to clean up your html. $content = preg_replace('~(<([uo]l)>.*</\\2>)~', "</p>$1<p>", $content); The above regex will wrap </p> and <p> before/after a list.
  7. Make sure thb_HomePageCategories() is returning an array. What is the output of printf('<pre>%s</pre>', print_r($categories, true));
  8. The problem is how do you know it is going to be an audio file? You might want to add a radio button which the user chooses video, or audio. When the form is posted you'd check what type of media they have linked to. When they select video, you'd run the code for embedding the video player. For audio you'd use their url in the html5 audio tag. // form <form> ... <p>Media Type: <input type="radio" name="type" value="Audio" /> Audio OR <input type="radio" name="type" value="video" /> Video?</p> <p>Link: <input type="text" name="media-link" /></p> ... </form> // php <?php if($_POST['type'] == 'audio') { // code for html audio tag } else { // code for embedded video player }
  9. What is the css you are using to style your inputs? Styling a field based on a name works fine http://jsfiddle.net/8LrhW/1/
  10. You'd have to analyse the domain of the url the user posts, so if the url contains youtube.com then it's a youtube video, if it contains vimeo.com the it is a vimeo video etc. Once you have found out the video source you can then inject their video url into the embedded player code, for youtube, vimeo etc. Example code $videoSource = parse_url($videoUrl, PHP_URL_HOST); // get the domain from the video url // display embedded video based on domain switch($videoSource) { case 'youtu.be': case 'youtube.com': // embedded player code for youtube video break; case 'vimeo.com': // embedded player code for vimeo video break; }
  11. Can you be more specific. What files should be played with what player? You tried using the HTML5 audio and video tags?
  12. You getting the notices because you are using keys to $_SESSION which do not exist. To fix the notices use isset before the use of the variable, example for line 14 if (isset($_SESSION['lockout']) && $_SESSION['lockout'] == true && (mktime() > $_SESSION['lastTime'] + 900)) If you have stored the security question in the database, then line 389 should be return $security_q;
  13. You may also want to check in your php.ini that output_buffering is set to Off.
  14. I'm not a Joomla user, but I dont think you want to use the readon tag, this is used for adding a Read More link to an article. Instead you need to open your page into Joomla's WYSIWYG editor press the link button to link to the file instead. Or if joomla allows html then use a html anchor tag <a href="images/repairs/returns policy process effective 1 feb 2014.pdf">Returns Policy Process (Effective 1 Feb 2014)</a>
  15. Where did you download Apache from httpd.apache.org or apachelounge.com If you got Apache from apache.org then you need to download Apache2.2 from apachelounge.com instead. The PHP distributions from windows.php.net/download are compiled with VC9 or VC11. The Apache binaries from apache.org are only compiled with VC6, making it incompatible with the PHP binaries from windows.php.net. Quote from php.net You may also need to download the VC9 or VC11 runtime from Microsoft too.
  16. No, because that is not valid syntax, Mac_gyver code will will return the last character from the string stored in $policytypeid. So if $policytypeid is set to FamilyR2 then substr($policytypeid, -1); will return 2.
  17. What have you tried so far? You can use glob to list all files in a directory. With glob you can easily filter out files you want to deal with. For example if you only want .mp4, .flv, and ogv files you can use "$videoDir/*.{mp4,flv,ogv}" as the pattern, making sure to use the GLOB_BRACE flag. You can get the date the file was created using filectime. For the file size you would use filesize
  18. So you have placed class.phpmailer.php in the includes folder? If that is the case then use require_once 'class.phpmailer.php'; The above lines should still worlk if you place that file in C:\websites\Test\ too
  19. Actually the newlines are included, the problem is the web browser ignores whitespace characters such as newlines, in order to inforce newlines in HTML you need to use the <br> (line break) tag. PHP has a function that converts whitespace newline characters into line break tags for you. Try using nl2br when you output the text for the forum posts. Use CSS to apply wordwrap to the .post-content class to break long continuous letters
  20. Use glob to get all files ending in .gif. $imgDir = 'img/'; foreach(glob($imgDir.'*.gif') as $image) { // do something with image } It is returning null for $root_dir because you have not defined it.
  21. You'd use a select query with a where clause checking for Status is set to "in_progress" and then limit the results to 1 with LIMIT 1 SELECT ID, Name, Status FROM table WHERE Status='in_progress' ORDER BY ID ASC LIMIT 1
  22. No the syntax is correct for the HTML, but PHP code is only parsed if it is within <?php ?> tags. @desjardins2010, have you tried <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=<?php echo $username; ?>" frameborder="0" width="728" height="2400" scrolling="no"></iframe>
  23. Use += instead of = Also to get $x squared you need to times it by itself $sum += $x*$x; // Or use pow $sum += pow($x, 2);
  24. The link I gave in post #2 gives example codes for file uploads. What have you tried so far?
  25. Netbeans opens each file into separate tabs. Select the file you want to run in the tab list and press Shift + F6 to run that file.
×
×
  • 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.