PHP search & replace from index.php text boxes?

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Sep 17, 2012 11:05 pm

if you do not want to use str_replace then you should see if pattern matching regular expressions will help you. Here is an article that may help you - ... ns-part-1/

New php-forum User
New php-forum User
Posts: 94
Joined: Sat Jul 07, 2012 1:36 pm

Tue Sep 18, 2012 1:57 am

So you will have many pages in the format ?
With the variable text different for each pagename (x), or whatever the parameter name is.
If so you could use a database table to store the different text values for each pagename, then reference the relevent text from the current url :

Table fields :

foreach($_REQUEST as $name=>$value) {
${$name} = $value;

$result = mysql_query("SELECT TEXT FROM TABLE_PAGES WHERE PAGENAME='$pagename'");
$row = mysql_fetch_array($result);
$thistext = $row['TEXT'];


// text box display

<input type="text" value="<?echo $thistext;?>" >

Post Reply