Jump to content

Create Variable Text?


Recommended Posts

Hello,

 

I am rather new to PHP, but quite familiar with HTML.

 

My question is, If I have a php file for example that looked like this:

 

<php
<variable text>
/php>

 

How could I create another PHP file with a simple form, that I can just type in my variable text and it will run the php script with the variable text in place.

 

Do you understand?

 

Thank's,

 

Tom Turner

Link to comment
https://forums.phpfreaks.com/topic/105241-create-variable-text/
Share on other sites

Really depends on how you want it to work. If you just wanted to run the users commands, you could use the eval() function on the string. If you wanted to save it for later, you could use fwrite()

 

Running user's commands is a very dangerous thing to do, however.

 

Perphaps if you told us a bit more about what you're trying to achieve, we could help more.

Link to comment
https://forums.phpfreaks.com/topic/105241-create-variable-text/#findComment-538883
Share on other sites

Really depends on how you want it to work. If you just wanted to run the users commands, you could use the eval() function on the string. If you wanted to save it for later, you could use fwrite()

 

Running user's commands is a very dangerous thing to do, however.

 

Perphaps if you told us a bit more about what you're trying to achieve, we could help more.

 

Thank you.

 

There is a script in the internet that gathers various information about a target source, but requires you to open the script and change the url you are targetting, manually each time. So I wanted to find a way to simply enter the target url into a online form, rather than reupload the file each time :)

Link to comment
https://forums.phpfreaks.com/topic/105241-create-variable-text/#findComment-538884
Share on other sites

Really depends on how you want it to work. If you just wanted to run the users commands, you could use the eval() function on the string. If you wanted to save it for later, you could use fwrite()

 

Running user's commands is a very dangerous thing to do, however.

 

Perphaps if you told us a bit more about what you're trying to achieve, we could help more.

 

Thank you.

 

There is a script in the internet that gathers various information about a target source, but requires you to open the script and change the url you are targetting, manually each time. So I wanted to find a way to simply enter the target url into a online form, rather than reupload the file each time :)

 

Why not just modify the script to take the url you are wanting to gather information for from the query string?

Link to comment
https://forums.phpfreaks.com/topic/105241-create-variable-text/#findComment-539097
Share on other sites

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.