Link to home
Create AccountLog in
Avatar of akohan
akohan

asked on

How to change two parameters in a PHP file?!

Hello group,

I'm writing a small web application which allows a user to upload a game (Flash base). Let's say user uploads a file called game.swf
On the fly, the code creates a game.php associated to the game. So now we have:
1) game.swf
2) game.php files on server.

The generated PHP file is a page and it also has the <embed> tag injected in it. Of course, it has two parameters as WIDTH and HEIGHT which specify the dimension of the game. So far, I don't have any issue.

The problem is that if the game owner decides to apply changes (such as name, description and etc) it works fine but I don't know how to change the width and height parameters which already are hard coded in the generated PHP file.

Is there any function that let me to change two or more values in an existing PHP/HTML file?

Any suggestions or advice will be appreciated.

Regards.
SOLUTION
Avatar of afzz
afzz

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of akohan
akohan

ASKER


Yes, it is small. I will give a try.

Thanks!
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of akohan

ASKER


Both methods were fine but the latter gave me more flexiblity.

Thanks to all.
Regards.