php - Change Variable Values by Form -
How can any PHP variables change PHP variables? I am using PHP scripts to display values on HTML pages
but I do not want to edit
Here my PHP scripts [data.php]
< Php $ web_title_en = "JDST blog"; // website title $ web_subtitle_en = "blah blah blah"; // website subtitles? & Gt;
and html (to display values) [index.html]
& lt; Html & gt; & Lt; Top & gt; & Lt ;? Php included 'data.php';; & Gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; & Lt ;? Php echo $ web_title_en; ? & Gt; & Lt; / H1> & Lt; H4 & gt; & Lt ;? Php echo $ web_subtitle_en; ? & Gt; & Lt; / H4 & gt; & Lt; / Body & gt; & Lt; / Html & gt; If you want to process html form with php, you should read it. Your form will look something like this: & lt; Html & gt; & Lt; Body & gt; & Lt; Form action = "data.php" method = "post" & gt; Title: & lt; Input type = "text" name = "title" & gt; & Lt; Br> Subtitles: & lt; Input type = "text" name = "subtitle" & gt; & Lt; Br> & Lt; Input type = "submit" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;
And this will be data.php (a merged version with your index.html)
& Lt; H4 & gt; & Lt ;? Php echo $ web_subtitle_en; ? & Gt; & Lt; / H4 & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Comments
Post a Comment