aleX_hill Posted March 21, 2008 Share Posted March 21, 2008 I dont know if anyone uses phpThumb, so I will explain the usage anyway. Usage: <img src=phpThumb.php?src=source.jpg&h=150> I am trying to hide my image url in the source, so I am trying to put the src into aa $_SESSION. In my while loop I have done this: $_SESSION['src'] = "path_to_file"; <img src="phpThumb.php?h=150"> and in the phpThumb.php file: $_GET['src'] = $_SESSION['src']; This works fine for the first image, but this image is repeated every time. I have tried putting a &rand=$rand on the end of the url in the <img> tag incase cache was the problem, to no avail. The session var is updated correctly, I am sure of that. Can someone tell me why phpThumb is not updating the image each time? Thanks, Alex Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 session data is only "updated" before any outputted headers or content. So if you try and set a session after you send output then the server won't have the updated headers. Quote Link to comment Share on other sites More sharing options...
aleX_hill Posted March 21, 2008 Author Share Posted March 21, 2008 Can you suggest a way of doing this? I was thinking of using $_POST but I think that would need a javascript routine to pass the $_POST through to the phpThumb.php ? Thanks, Alex Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted March 21, 2008 Share Posted March 21, 2008 use a database intermediate and pass via GET the database id. Quote Link to comment Share on other sites More sharing options...
aleX_hill Posted March 21, 2008 Author Share Posted March 21, 2008 In that case, do you know any file uploaders that will put the files in a database? At the moment I FTP the images to a dir, and just read the files straight from the dir. Alex Quote Link to comment Share on other sites More sharing options...
aleX_hill Posted March 21, 2008 Author Share Posted March 21, 2008 I guess I could use the same while loop to add files from the folder to the database and run as a conjob or similar... looks like I have some more work to do. Alex Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.