Jump to content

Create image in page


f3tus

Recommended Posts

Basically, I have 3 files:

 

index.html

process.php

image.php

 

What I want to do is get text from index.html via a form, then in process.php output some text, then show an image in process.php with img src to image.php that converts said text into an image.

 

I can get this to work by adding a variable such as image.php?var=$text to img src, but I would want the image.php to be without a variable, so users can't just go to site.com/image.php?var=something.

 

How do I pass the variable to image.php in process.php and then show it with img src=“image.php“?

Link to comment
https://forums.phpfreaks.com/topic/194946-create-image-in-page/
Share on other sites

You can use a session.  Open a session in process.php and store the variable there.  Just be sure to close the session (session_write_close()) before you send the IMG tag to the browser.  If this is the only reason you are using the session, you can destroy it in the image.php (session_destroy()) after you get the value out of it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.