Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. I believe Google has links to such scripts.
  2. glob Look in the user comments section for "rglob". You can also use scandir, also look in the user section for the recursive version of this.
  3. birthday ($row_getdets['dob']); function birthday ($birthday){
  4. http://www.draftlight.net/dnex/mp3player/minicaster/
  5. desc is a reserved mysql word. Either encase it in back ticks ( ` ) or rename that column to a non-mysql reserved word.
  6. mysql_select_db("moviecollection", $con); $insert="INSERT INTO authors (name, email, website) VALUES ('".$name."', '".$email."', '".$website."')"; if (!mysql_query($insert,$con)) { die('Error: ' . mysql_error()); } echo "1 record added to table 1<br />"; ////////////////////////////////////////////////////////////insert into second table $insert="INSERT INTO post (title, img, desc, cat_id) VALUES ('".$title."', '".$img."', '".$desc."', '".$cat_id."')"; if (!mysql_query($insert,$con)) { die('Error: ' . mysql_error()); } echo "1 record added to table 2"; mysql_close($con)
  7. premiso

    Page break

    Why not just use <br /> ? Sorry. Just read the "Page Break" wrong. Thought you meant a line break
  8. while($row = mysql_fetch_array( $num3 )) { $number3 .= $row['base']; } echo $number3; You have to concatenate the value in order to achieve that.
  9. Do you have any example on how to read the docs? QFT
  10. Just for shits and giggles. You can go ahead and download SMF 2.0 RC2, and install it then fix it yourself and email the files to an Admin suggesting they update this, and also upload it to SMF so they can fix their core code as well. As far as anyone else going to do this, no chance. I have never had any problems with the forums and if you are using IE8 switch it to compatability mode and see how that jives or, GASP, switch to a real browser like Chrome or Firefox!
  11. Not sure if this was just your typo, but this would be the better way to echo it, as <?= requires short_open_Tags to be on in the php.ini <?php echo $_REQUEST['kwd']; ?> But given that this is displayed in the title: <title>Your Site - <?php echo REQUEST['kwd']; ?></title> PHP is not being parsed by your server / your server is not setup to handle PHP requests.
  12. $var1 = "SELECT * FROM payments WHERE "; $and = array(); $and[] = "monthid = '1'"; $and[] = "salesmanID = '1'"; $var1 = $var . implode(" AND ", $and); echo $var1; Using arrays and implode this can be done pretty easily. (Given that I did not mess up my syntax as this is untested).
  13. Why not just try and replace the / with -'s using str_replace. That or have them as seperate fields and then combinte them into a string on input. Strtotime does not work as it creates a UNIX Timestamp, if it is passed a string it can handle / convert.
  14. Probably using Dreamweaver you can. But all in all with just PHP, nope. You will have to find a program, like dreamweaver, that works for you.
  15. There is by using regular expressions: preg_replace I am just too lazy right now to figure out the regex needed.
  16. $string=str_replace(",8,", ",", $string); Should do the trick.
  17. For MySQL injections simply use mysql_real_escape_string on form data. This will do proper escaping. But you should always validate the data before you insert it. If you expect a URL, do a regex to make sure the URL is a valid URL and not some random set of characters etc. As for the URL sanitizing, it is great to sanitize, but beware of xss exploits if you are using that url in some form or another.
  18. It is not "suggested" but for testing purposes, try the absolute path to the image to see if that works. If it does, then it is a path issue. Absolute path being http://www.yoursite.com/images/image.jpg. It is not suggested for CSS stuff for the reason that if you change domain names etc, you have to manually fix this. If the absolute path works, try a variation of relative paths, as Karl suggested, but ../ may work as well etc. See if that fixes the issue. If, however, the absolute path does not work, something else is going on and the images are not where you are expecting them to be.
  19. Something is weird about your server. By all means that I know $_SERVER['DOCUMENT_ROOT'] should point to: /home/p/o/powtest/web/public_html/ Not "htdocs". Is htdocs set as a symbolic link? Are you on a shared server or VPS or your own? If your own / VPS, you should be able to fix this in the vhosts file, but yea. I do not know what the reasoning it is set to htdocs and thus cannot help effectively.
  20. PHP has nothing to do with the CSS / images unless a php script is serving either or. WIthout any code hard to help, but you probably wanted the CSS Section / Client Side section. Of course, unless PHP is actually dishing out / processing images or the css files.
  21. Your "SITE_ROOT" should be defined with $_SERVER['DOCUMENT_ROOT"] and not the web path. The webpath simply displays the file after processing. So most include files, which generalyl do not display data, will display nothing and thus include nothing. The DOCUMENT_ROOT is the path on the actual server, IE: /var/www/site.com/htdocs/ vs http://www.yourdomain.com/ But that is not the problem, the problem is you are using a relative path to locate the intiialize.php I would use the absolute path instead: require_once($_SERVER['DOCUMENT_ROOT'] . "/PHP_Training/beyond_the_basics/photogallery/includes/initialize.php"); Given that intialize.php is in the root directory should work on all pages. To fix your SITE_ROOT declaration: defined('SITE_ROOT') ? null : define('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'] . DS .'PHP_Training'.DS.'beyond_the_basics'.DS.'photogallery'); This will provide the actual location and not the web location so it accesses the actual file and not the webversion.
  22. Maybe, it depends on what he needs. I was going off the way to get the data out for the: But yea, that is probably only half of the solution...
  23. There is probably a better way to write the regex but here is one that works: preg_match_all('~\[\[([\w\d]+?)]]~', $content, $matches); Then looping through $matches[1] with foreach should pull out just the names. EDIT: Removed the .* and changed to match only letters and digits. If you need to be "all inclusive" change the [\w\d]+ to be .*
  24. <a href="edit.php?id=contentid">Edit Entry</a> Where contentid is fetched from the database and is an identifying field for that entry. Then just use $_GET['id'] on the edit.php to get the id that needs to be populated in the edit form.
  25. You can try ffmpeg to extract a screen shot of the video. Not sure how it is done, but I am sure google will yield some results.
×
×
  • 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.