
Distant_storm
Members-
Posts
137 -
Joined
-
Last visited
Never
Everything posted by Distant_storm
-
hmmm seems a very complex app for what id consider very little use lol. Phpreeks suggestions is best. PHp is not the easiest to grasp, you would also need some oop theory and practice. You would need to structure how the app works theoretically, then graphically and process. So How do people get their plant to grow What happens when their plant grows Does the plant last forever is their only a selection of plants to choose from ? All these questions are what your app needs to answer theoretically graphically as stated above an app of a growing plant is boring as if there is no graphcis this would require either Gif/static images or flash integration. The graphcis need to be apealing and large. If everyone had the same plant er Whats the point ! would be a question. Process wise the php side of it would be quite big, firstly getting to grips with facebooks platform and using their class's and such is quite hard for me and ive been php programming for 3 years. Hope that gives you some insite. My moto is start small and it will end up big, If you start big you will get to the start of it, get bored flustrated or stuck. It will be time consuming. Get one idea very simple once you have done that Exapnd it and so forth. You will then actully get some projects going.
-
[SOLVED] Resize image and save it.
Distant_storm replied to Distant_storm's topic in PHP Coding Help
bumpage -
ok as many of you may have noticed im working with Gd a fair bit. I want to resize my image before I add watermark to it. I have looked up some examples but they seem to create black bars when the image is not fitting the desired fit. I want it to just resize the image to or below a specific height and widht then save that image, has anyone got a very simple way to do it. I can calculate the image size and that just the function for resizing the image is what i need help with
-
If i am adding a watermark and saving the output imagejpeg($image); imagedestroy($image); imagedestroy($watermark); and i am using ImageJpeg($captchaimage,"image.gif"); to save the image ? Do i still need to use header('content-type: image/jpeg'); as im not planning on displaying the image just saving it ?
-
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
hmm Thanks helraizer for that link read up about it, seems to explain it pretty clear although 'fudge factor' haha what name. Think I may use the image merge instead of this method as it seems to be a little complex for its purposes Thanks again for everyones help -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
Sorry yes $row includes the / -
debug it when it says they arnt correct. Print out session values and what the sessions values are being checked against. Make sure their are no trailing spaces or leading spaces...
-
Personally id use htaccess and restric access You can deny everyone or only allow requests from your domain or an ip address Search google for htaccess hotlink protection.
-
If you are using a session for a login script you should assign it some value for you to check. such as page 1: session_start(); // if the user is authorised and has just logged in create session $_SESSION['auth']= TRUE; $_SESSION['user_id'] = "mememe"; $_SESSION['password_key']="THINGIMIJIG"; header("LOCATION:nextpage.php"); page2: session_start(); #check user is logged in if (isset($_SESSION['auth'])) { //dazel them with your website } Hope that helps
-
how to explode info stored in database to fill out a form.
Distant_storm replied to jbrill's topic in PHP Coding Help
$string_from_database="1;2;3;4;5;6;7"; $array_your_making= explode(';',$string_from_database); $count_the_array_values=count($array_your_making); for ($n=0; $n < $count_the_array_values; $n++) { echo $array_your_making[$n] . "<br>"; } part one is the string you got from your database part two you split the data up part three you count the values of the array part four you make a loop until the end of the array part five you send to the page the values of the array this should output 1 2 3 4 5 6 7 Thus breaking a string into an array ... ? -
Sorry can you be a little clearer.. You want to stop your script being run if it is not running on your domain name ?
-
Passing some work to another programer is this acceptable
Distant_storm replied to cooldude832's topic in PHP Coding Help
ahh get you very clever, I never saw any reason why code couldn't be passed on aslong as your the one that produced it. -
how to explode info stored in database to fill out a form.
Distant_storm replied to jbrill's topic in PHP Coding Help
$array_name = explode(';',$string_from_database); $array_name is the new array name you want explode is the function ';' is defining where one array element ends and next begins $string_from_database is the string you want to break up you can then asess the array by $total_array_elements = count ($array_name); for ($n=0; $n < $total_array_elements; $n++) { //Do something here with your data } er hope that helps -
Passing some work to another programer is this acceptable
Distant_storm replied to cooldude832's topic in PHP Coding Help
what the funk is reversed engineered email :S -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
I am pretty sure that my ini settings are still default which i believe is 8mb. I am testing image which are 726kb and they are jpg. I duno if they have to be non progressive ? I have had some results which just show a box with red x, although i keep getting this error message There is no line 83 because i haven't included all my code but i will.. <?php //image upload handel #Connect to database get file listing if ($dbc = @mysql_connect('host','user','xxxxx')) { if (@mysql_select_db('db')) { $query="SELECT * FROM table"; if ($r = mysql_query ($query)) { while ($row = mysql_fetch_array($r)) { $base_url_temp=$row['xxx']; $base_watermark=$row['xxxxx']; } } // atempt to upload file $allow_file="FALSE"; $allowed_file_types = array(1=>'image/gif',2=>'image/pjpeg',3=>'image/jpg',4=>'image/jpeg',5=>'image/JPG',6=>'image/JPEG',7=>'image/pjpg',8=>'image/png'); $total_file_types= count($allowed_file_types); for($c=1;$c < $total_file_types; $c++) { if ($allowed_file_types[$c] == $_FILES['photofile']['type']) { $allow_file="TRUE"; } } if ($_FILES['photofile']['size'] > "8388608") { $allow_file="FALSE"; } if ($allow_file == "FALSE") { exit("file was too big or wrong type" . $_FILES['photofile']['type'] . "<br>" . $_FILES['photofile']['size']); } if (move_uploaded_file ($_FILES['photofile']['tmp_name'],".." . $base_url_temp . "/" . $_FILES['photofile']['name'])) { echo "file uploaded"; } else { echo $_FILES['photofile']['error']; } $file_allocation= ".." . $base_url_temp . "/" . $_FILES['photofile']['name']; //watermark image function makeRGBColor($color,$image) { $color = str_replace('#',"",$color); $red = hexdec( substr($color,0,2) ); $green = hexdec( substr($color,2,2) ); $blue = hexdec( substr($color,4,2) ); $out = imagecolorallocate($image,$red,$green,$blue); return($out); } $font="arial.ttf"; $fontsize=18; $padding=18; list($width, $height, $type, $attr) = getimagesize($file_allocation); $textx= $padding; $texty= $width - $padding; $captchaimage = ImageCreateFromJpeg($file_allocation); $textcolor= makeRGBColor('A8ADB4', $captchaimage); imagefttext($captchaimage,$fontsize,0,$textx,$texty,$textcolor,$font,"Kayleigh.co.uk"); $line = makeRGBColor('FFFFFF',$captchaimage); for ($i = 0; $i < 3; $i++) { $xstart= rand (0,$width); $ystart= rand (0,$height); $xend= rand (0,$width); $yend=rand (0,$height); imageline($captchaimage,$xstart,$ystart,$xend,$yend,$line); } header ('content-type: image/gif'); ImagePng($captchaimage); ImagePng($captchaimage,"captcha.gif"); ImageDestroy($captchaimage); } } ?> -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
Erm i Think ibroke it ? This error Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 11392 bytes) in XXXX/XXXXX/XXXXXX/XXXXXX on line 83 What does that erorr mean ? this is my code up to now... $file_allocation= "../" . $base_url_temp . "/" . $_FILES['photofile']['name']; //watermark image function makeRGBColor($color,$image) { $color = str_replace('#',"",$color); $red = hexdec( substr($color,0,2) ); $green = hexdec( substr($color,2,2) ); $blue = hexdec( substr($color,4,2) ); $out = imagecolorallocate($image,$red,$green,$blue); return($out); } $font="arial.ttf"; $fontsize=18; $padding=18; list($width, $height, $type, $attr) = getimagesize($file_allocation); $textx= $padding; $texty= $width - $padding; $captchaimage = ImageCreateFromJpeg($file_allocation); $backgroundcolor= makeRGBColor( 'EDEDED',$captchaimage); $textcolor= makeRGBColor('A8ADB4', $captchaimage); imagefttext($captchaimage,$fontsize,0,$textx,$texty,$textcolor,$font,"Kayleigh.co.uk"); $angle= rand(-20,20); $captchaimage = imagerotate($captchaimage,$angle,$backgroundcolor); $line = makeRGBColor('FFFFFF',$captchaimage); for ($i = 0; $i < 3; $i++) { $xstart= rand (0,$width); $ystart= rand (0,$height); $xend= rand (0,$width); $yend=rand (0,$height); imageline($captchaimage,$xstart,$ystart,$xend,$yend,$line); } header ('content-type: image/png'); ImagePng($captchaimage); ImagePng($captchaimage . "../" . $base_watermark . "/captcha.png"); ImageDestroy($captchaimage); any help will be much apreciated, I have never seen that error message before is the file just too big or something? -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
ahh and just change jpg to gif and such ? and also what if its JPEG will that matter ? Do you have any suggestions for the end stage of saving the file -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
Ok ive made upload script uploads a file to a specific folder. From that image now I want to watermark it although ive seen a watermark code which takes another image and merges it with the origonal image. I don't want to do it this way. I want to use my captcha method of actully putting text onto the image and lines. although I don't know how to go about it because ive used functions to create the captcha from scratch rather than image. like so function makeRGBColor($color,$image) { $color = str_replace('#',"",$color); $red = hexdec( substr($color,0,2) ); $green = hexdec( substr($color,2,2) ); $blue = hexdec( substr($color,4,2) ); $out = imagecolorallocate($image,$red,$green,$blue); return($out); } $font="arial.ttf"; $fontsize=18; $padding=18; $wordbox= imageftbbox($fontsize,0,$font,$target); $wordboxwidth=$wordbox[2]; $wordboxheight=$wordbox[1]; + abs($wordbox[7]); $containerwidth = $wordboxwidth + ($padding *2); $containerheight = $wordboxheight + ($padding * 2); $textx= $padding; $texty= $containerheight - $padding; $captchaimage = imagecreate($containerwidth,$containerheight); $backgroundcolor= makeRGBColor( 'EDEDED',$captchaimage); $textcolor= makeRGBColor('A8ADB4', $captchaimage); imagefttext($captchaimage,$fontsize,0,$textx,$texty,$textcolor,$font,$target); $angle= rand(-20,20); $captchaimage = imagerotate($captchaimage,$angle,$backgroundcolor); $line = makeRGBColor('FFFFFF',$captchaimage); for ($i = 0; $i < 3; $i++) { $xstart= rand (0,$containerwidth); $ystart= rand (0,$containerheight); $xend= rand (0,$containerwidth); $yend=rand (0,$containerheight); imageline($captchaimage,$xstart,$ystart,$xend,$yend,$line); } header ('content-type:image/png'); imagepng($captchaimage); Although i want this instead of on image box onto my image I then want to save that image instead of it just being destroyed. Any help would be much apreciated thanks -
[SOLVED] Upload and watermark with a slight edit ?
Distant_storm replied to Distant_storm's topic in PHP Coding Help
er bump -
I am looking to make a click and buy system with paypal. I never heard of this automated process with paypal might look into it myself although im thinking it is going to be heavy object orientated. Switch control proberbly just gets the result from paypal and you make a decision based on the result correct ?
-
Ok ive made a captcha as just practice with image stuff. although I want now to be able to do the following... 1) Specify the temporary location for a upload file 2) not as much watermark the image but create image like a captcha making lines on it and some text 3) Destroy the temp image and the fully uploaded image 4) save the watermarked image. Any ideas on how id go about it .
-
So to summerise the best thing to do it ban any uses causing havock and log all their details to take further actions, but effectivly banning by ip is usless.
-
Sorry not totaly on subject but im a little rusty when it comes to this. but when people refer to accessing the site through a proxy does that mean going to another server and using that server to get to the site ?
-
I am not having any current problems but im always tight on security and have always found ip banning a little redundant as I see when i log on my site who visits my own ip address changes in pretty much all octlets apart from the first one. In my basic electronics I know that ip address represent network and such things but if its changing all the time there is really no reason on banning it is their?