
Distant_storm
Members-
Posts
137 -
Joined
-
Last visited
Never
Everything posted by Distant_storm
-
My php script works like this it checks if the sessions is present and the values against a database and will direct to where they should be directed. If their login is wrong their directed to login page or if the session value isnt present then they are redirected. Now all of a sudden it is being tempremental and redirecting to login at what seems to be random times navigating around the system
-
I think the watermark can be remote imagepng($image,".." . $base_watermark . "/$new_file_name." . $file_type); change these in the switch to imagepng($image); to get the image displayed on screen.
-
Topic covered.... http://www.phpfreaks.com/forums/index.php/topic,170674.0.html addapt varaibles Don't forget because of the fudge factor which makes the memory used within memory limit will be alot more than ur image... so make it ini_set("memory_limit","40M"); and you won't get the server is exahusted. Id recomend breaking the script up into two seperate files. 1 for resize image and save it 2 resend paths of files new and old to second file 3 new file watermarks image from file and outputs it
-
I still get an error even when i have increased allowed memory size of 12582912 bytes exhausted (tried to allocate 11264 bytes) so the memory size is bigger then what its trying to allocate ? do i need to increase something else ?
-
[SOLVED] Making sql statment short
Distant_storm replied to Distant_storm's topic in PHP Coding Help
ok a form sends back X amount of ID's which corrispond to fields in a table which identifies records eg ID Data 1 a 2 b 3 c 4 d Now say the form sends the id's 1 3 and 4 I want the script to change the data of 1 3 and 4 to the word Blah how would i do this using an update query such as "UPDATE table_name SET data='blah' WHERE ID='$id'"; ok thats the type of thing i want to do, but as their could be any amount of Id's so how would i go about it -
I have been having problems with my image stuff... Ok heres what my system does... Uploads image.. resizes and saves,gets rid of gd image stuff, addswatermark and saves, gets rid of unwanted gd image data, saves However my upload is set to 2M. However I don't think this is the issue. If I upload an image that is only 1.1 mb i get this error message. Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 2816 bytes) in /XXX/XXX/XXXX.php on line 89 Line 89 onward is ... $file_allocation= ".." . $base_url_temp . "/" . $_FILES['photofile']['name']; $file_allocation_new = ".." . $base_url_temp . "/1" . $_FILES['photofile']['name'] ; switch ($file_type) { case "jpg": $src = imagecreatefromjpeg($file_allocation); break; case "gif": $src = imagecreatefromGif($file_allocation); break; case "png": $src = imagecreatefromPng($file_allocation); break; } Would it help if i put parts of the script into a new script ? Or do i need to do something else?
-
I have never been that good at making sql statments i only know a limited amount of query language. I have a database table which i need to update several items via their ID. so I have a set off image which can be any amount with checkboxes... if the image is checked then that image in the database table should be updated. it would look like "SELECT * FROM the_photo_album WHERE id={$_POST['checked_image']}"; now instead of putting it OR this or that would it be best to loop through each one updating each one everytime it loops ? hmm any help would be apreciated, also if anyone has any links to good querys e.t.c that be good
-
I have been programming in php for a while now I would say im fairly experienced although I have never attempted or looked up on methods for destructive perposes. I know alot of you here if you wanted too could take down sites and abuse them. However im not asking on instruction on how to do this as i know various theories, I feel that as a programmer im not truley good as their is someone out there that could take down my site just because he looked up some google code or something. If anyone has used php for abusive perposes did you just look it up or ? figure it out for yourself.
-
What should i specify the size in bytes mb or ?
-
|Can anyone answer my questions ? :-\
-
bump lo
-
I don't have access to my php ini How do i turn off expose php and increase the max upload limit Either using ini set or htaccess, im not clear how i do it with htaccess sorry ?
-
How can I change the upload_max_filesize in the ini i don't believe I can use ini_set or out I think i have to do it some other way ? and also expose_php if that is set to on is that a problem it sounds bad ?
-
It's not determined by the sender whether or not the email goes into the junk box. It's up to the recipients settings. then again, on hotmail, just about everything goes into junk unless the senders email address is in their address book. I'd suggest asking the recipient to add your email address to the contacts. Do sites like facebook use a different method of seding email as it doesn't go into my junk mail ,yet is not added to my add book
-
Leave database running. Copy database to local host intranet still uses the database on the intranet while she can edit the copied version at home When she comes back on the old database is overwrittenby the new one
-
Does anyone have any links to tutorials on headers. Is there anyway to stop a php script from the mail being directed to the junk box ?
-
The more advanced you make your captchas the more advanced the bots become to get past them !.... The most effective as stated above is cognitive captchas. although for minimal security simple distorted text images are easily done.
-
what advantages are there to using all that code as stated at start of topic compared to the simple validation and mailto job ? most of its forign to me like what the freak is a mimboundary and why do you send headers for this i want to know
-
I get memory exausted when trying to upload a fair sized image and manipulating it with gd module.
-
bump
-
I have seen a small snippet of code which increases the memory usage of php, I don't want to increase it a huge amount above the limit already which i think is 8 mb. I have searched manual and found nothing about setting it. Is there any downfall to setting it slightly higher ? and what is the code for setting it in the ini ? thanks
-
[SOLVED] Get containing folder name of referrer
Distant_storm replied to lindm's topic in PHP Coding Help
yes just parse the url note though that not all users will allow referer to be passed and it may return blank, you should acommodate for this too. -
[SOLVED] Watermarking Directory Of Files
Distant_storm replied to fanfavorite's topic in PHP Coding Help
Ive used your code to resize my images so its only sensible you use mine to watermark your images $watermark = ImageCreateFromGif('watermark.gif'); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); $image = imagecreatetruecolor($watermark_width, $watermark_height); //create image if (strstr($file_allocation_new,'jpg') || strstr($file_allocation_new,'JPG') || strstr($file_allocation_new,'jpeg') || strstr($file_allocation_new,'JPEG')) { $file_type="jpg"; } if (strstr($file_allocation_new,'png') || strstr($file_allocation_new,'PNG')) { $file_type="png"; } if (strstr($file_allocation_new,'gif') || strstr($file_allocation_new,'GIF')) { $file_type="gif"; } switch ($file_type) { case "jpg": $image = imagecreatefromjpeg($file_allocation_new); break; case "gif": $image = imagecreatefromGif($file_allocation_new); break; case "png": $image = imagecreatefromPng($file_allocation_new); break; } $size = getimagesize($file_allocation_new); $dest_x = $size[0] - $watermark_width - 5; $dest_y = $size[1] - $watermark_height - 5; imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, 100); switch ($file_type) { case "jpg": imagejpeg($image,".." . $base_watermark . "/$new_file_name." . $file_type); break; case "gif": imagegif($image,".." . $base_watermark . "/$new_file_name." . $file_type); break; case "png": imagepng($image,".." . $base_watermark . "/$new_file_name." . $file_type); break; } imagedestroy($image); imagedestroy($watermark); $file_allocation_new is the path of your image $base_watermark and $new file name are just parts of the path that make up the place you want to save the watermarked image too. if you do not want to save the image just take out the path bit. If you want to do this for every file in a directory You would have to use this script on each individual one. I have gone the long way round with determin the type of file it is. You can just use part of the getimage size to switch the type of file jpg gif or png. I haven't used bmp in my system but i believe you can use bmp too Hope that helps dude. -
You want to search within a page ??? use cntrl F haha