[HELP] Need simple php file

I need a php file so on my page there can be a text box this a button. When the button is pushed it finds some of the text in the box and loads the next page but with a word changed.

So if someone typed “this word changed” then the next page it would be “this thing changed” So “word” turned into “thing”.

I am guessing this is done with php and hopefully will not be too difficult.

Thanks if you can figure this out :slight_smile: I will give you credit on the actual site if this is done.

Post here or PM me. Thanks!

:slight_smile:

Sorry about the spelling :frowning:

My guess would be:

[php]

[/php]

Then in page.php:

[php]

<?php $words=$_POST['words']; if(words == 'this word changed') { $words='this thing changed'; } echo $words; ?>

[/php]

You could also do: (for page.php)
[php]
$words=$_POST[‘words’];
$words=replace(‘word’, ‘thing’, $words);
echo $words;
[/php]

The last one may be incorrect but if so, just search up the replace command. :wink:

Alright, here is a modified post that is much easier and the commands are correct. :wink:

[php]

<?php if(isset($_POST['submit'])) { $words=$_POST['words']; $words=str_replace('word', 'thing', $words); echo $words; } ?> [/php]

Thank-you man! :o

I can’t believe you did that easily :smiley:

Thanks again. :-*

Sponsor our Newsletter | Privacy Policy | Terms of Service