Re: [PHP] Strange_session-problem_with_php-file_in_img_src
fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett: Instead of trying to tell us what the problem is, just explain what trouble you are having. We can then tell *you* what the problem is. Could the problem have something to do with the fact that the function that returns the value of the session is called from within another function, and that it's defined outside this function? Sincerely Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange_session-problem_with_php-file_in_img_src
Problem solved. The error came because I was calling the function inside another function, outside the latter it worked good. So I simply passed the variable with the second function - works great! Thanks anyway for all your time trying to help me! /V -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange_session-problem_with_php-file_in_img_src
--- Victor [EMAIL PROTECTED] wrote: img src=createjpg.php?id=xyz ... The problem is that since the file createjpg.php is'nt loaded in the browser as and ordinary file, it doesnt recognizes the session variable. When a browser requests an image, the request is identical to a request for any other resource, be it a .html file or a .php script. It will send cookies, URL variables (if they are in the src attribute as your example shows), and anything else that a normal request includes. Instead of trying to tell us what the problem is, just explain what trouble you are having. We can then tell *you* what the problem is. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange_session-problem_with_php-file_in_img_src
fredagen den 31 januari 2003 kl 18.08 skrev Chris Shiflett: Instead of trying to tell us what the problem is, just explain what trouble you are having. We can then tell *you* what the problem is. Ok, first I have the function session_start(); function return_session_raettighet($session = null) { if ( isset($session) ) { return $session; } else { return 0; } } I ask this function to return the value of a specifik session, that is, if the user is logged in the value is at least 10. Then I perform if(return_session_raettighet($HTTP_SESSION_VARS[session_raettighet]) 10) { ImageAlphaBlending($img_des, true); $im_copy = imagecreatefrompng(const_picture_dir . /copyright.png); $copy_imgsize = GetImageSize(const_picture_dir . /copyright.png); $copyxloc = (($imgwidth + (2*$kant))/2)-($copy_imgsize[0]/2); $copyyloc = (($imgheight + (2*$kant))/2)-($copy_imgsize[1]/2); imagecopy($img_des, $im_copy,$copyxloc,$copyyloc,0,0,$copy_imgsize[0], $copy_imgsize[1]); } this means, that if the user is not logged in, a copyright © sign will appear over the image. And this fails Don't know why because the same code works on other pages Sincerely Victorr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php