Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.