Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. change if (empty($_POST['$unsafestring'])) { to if (empty($unsafestring)) {
  2. the only ways i know of are listed above, any module would have to be setup on the server, (so your need access to it), and if you have access then you could just use ServerSignature Off you could use modsecurity, but your have to readup on it see here find "Server identity masking" hope that helps as thats the best i can offer
  3. You CAN'T via a PHP script. Other headers you can change.. but good luck in your search.
  4. Depends on rights, but drop database will do it DROP {DATABASE | SCHEMA} [iF EXISTS] db_name
  5. thats the most common way but try this SELECT * FROM `quotes` WHERE id >= (SELECT FLOOR( MAX(id) * RAND()) FROM `quotes` ) ORDER BY id LIMIT 1; i assume you have an ID field! it seams to take up less CPU and be more random (win win)
  6. just make sure the photo_id in comments is the same as the one in photo, !! i am assuming you havn't worked with databases before, i suggest you do some research!
  7. what about imagecopyresized
  8. #1 send the user id and lookup (the email via the id) before sending the mail #2 encrypt the email address and then decrypt it on the next page.
  9. can't you just pass the mailing info to a php page that uses mail! (of course this will show up on the mail sent)
  10. only options are #1 edit the php.ini file, add post_max_size = 8000000 upload_max_filesize = 8000000 #2 try adding this to your script ini_set('post_max_size', '8M'); ini_set('upload_max_filesize', '8M'); #3 try adding this to your .htaccess file: php_value post_max_size 8M php_value upload_max_filesize 8M **note edit these sizes (i used 8Mb for the examples)
  11. Search the fourm.. i see these posts about twice a week..! basically edit your php.ini file!
  12. well firstly you it would be better if you have a folder with you images in and hold the image filename, as for the script try this image.php?image=doggy.jpg <?php // 'watermark' in the upper left of an image $my_text = 'watermark'; // open image and lay white text on it.. $img = imagecreatefromgif ('testpic.gif'); $white = imagecolorallocate($img, 255, 255, 255); // white imagestring($img, 4, 6, 3, $my_text, $white); // size 4 built-in font // send the image header("Content-type: image/gif"); imagegif($img); imagedestroy($img); ?> change page2.php to image.php in my previous script, to get the filetype you can just get the last 3 characters (won't work on renamed files ie test.gif to test.jpg) for jpeg use imagecreatefromjpeg and imagejpeg a switch to break them into groups would be best
  13. Can you click solved please
  14. ok <?php foreach($photos as $x) { echo "<img src='{$x['url']}'></img><a href='page2.php?image={$x['url']}' target='_blank' >Link text</a>"; } ?> page2.php <?php echo "hello<br>"; echo "<img src='{$_GET['image']}'></img>"; echo "world<br>"; ?>
  15. update for DaveEverFades code <?php foreach($photos as $x) { ?> <img src="<?php print($x['url']); ?>"> </img><a href="<?php print($x['url']); ?>" target='_blank' >Link text</a> <?php } ?> revised <?php foreach($photos as $x) { echo "<img src='{$x['url']}'></img><a href='{$x['url']}' target='_blank' >Link text</a>"; } ?> EDIT: missed the _
  16. #1 USE CODE TAGS #2 remove ?>
  17. humm <META http-equiv="Content-Type" content="text/html; charset=utf-8"> should be fine.. can you show some of the html please
  18. if its always at the end, use trim(), i had the same problem, (a CR at the end lines) TRIM resolved it, shout and simple
  19. it looks fine, try checking the manual
  20. its the page encoding, change to general unicode
  21. ow well spotted kenrbnsn, plus mysql_real_excape_string() should of returned an error,
  22. Its been a long week.. corrected (kinda) <?php session_start(); function do_count($tra) { // $tra = 0; //remove, otherwise the function always returns 1 $tra++; return ($tra); } if(isset($_SESSION['counter'])) { $tra = $_SESSION['counter']; }else{ $tra = 1; } $_SESSION['counter'] = do_count($tra); // need to do something with returned result, such as echo it. echo $_SESSION['counter']; ?> But Barand's is a "real" solution
  23. OK heres a quick one (for testing) in other words this will last as long as a session, a kinda bad example but you've just started to learn PHP see my first post for adding a file. <?php session_start(); function do_count($tra) { // $tra = 0; //remove, otherwise the function always returns 1 $tra++; return ($tra); } if(isset($_SESSION['counter'])) { $tra = $_SESSION['counter']; }else{ $tra = 1; } echo do_count($tra); // need to do something with returned result, such as echo it. ?>
  24. it works but you need to store the old value to prove it works try <?php function do_count($tra) { // $tra = 0; //remove, otherwise the function always returns 1 $tra++; return ($tra); } $tra = 1; echo do_count($tra); // need to do something with returned result, such as echo it. echo "<br>"; echo do_count($tra); echo "<br>"; echo do_count($tra); echo "<br>"; echo do_count($tra); echo "<br>"; ?> Barand's posting i'll leave him to it
×
×
  • 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.