-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
change if (empty($_POST['$unsafestring'])) { to if (empty($unsafestring)) {
-
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
-
reducing image resolution of an uploaded image
MadTechie replied to golem's topic in PHP Coding Help
ok just use imagejpeg -
You CAN'T via a PHP script. Other headers you can change.. but good luck in your search.
-
Depends on rights, but drop database will do it DROP {DATABASE | SCHEMA} [iF EXISTS] db_name
-
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)
-
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!
-
reducing image resolution of an uploaded image
MadTechie replied to golem's topic in PHP Coding Help
what about imagecopyresized -
#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.
-
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)
-
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)
-
Search the fourm.. i see these posts about twice a week..! basically edit your php.ini file!
-
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
-
Can you click solved please
-
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>"; ?>
-
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 _
-
Parse error: parse error, unexpected '?' in
MadTechie replied to morpheus729's topic in PHP Coding Help
#1 USE CODE TAGS #2 remove ?> -
humm <META http-equiv="Content-Type" content="text/html; charset=utf-8"> should be fine.. can you show some of the html please
-
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
-
it looks fine, try checking the manual
-
its the page encoding, change to general unicode
-
ow well spotted kenrbnsn, plus mysql_real_excape_string() should of returned an error,
-
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
-
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. ?>
-
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