|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
php to html
my problem: I want to try a site where I can fill in e.g. the bg color (e.g. red) in a textbox. then I want it applied on the next site, WHICH SHOULD BE A HTML SITE. so I´d have to make a php site in between which generates it and converts it in a html site. is that possible? I think so, but I dont know how to make it.
|
|
#2
|
|||
|
|||
|
RE: php to html
It is possible. You would need to look into the file functions. Namely fopen, fclose, fputs. With these you can open a file and write whatever you wanted to the file....
|
|
#3
|
|||
|
|||
|
RE: php to html
Another solution - use javascript. You could set a cookie with this script if you wanted, too. Check it out:
<script language="javascript"> function changeIt() { var bground = document.form1.colorbox.value document.bgColor = bground /* //place exceptions here if needed, you might want //to set the text color as an exception //remove the /* and */ tags to use exceptions if (bground == "blue") { document.bgColor="#ccceee" alert("No, not " + bground + ", be more original! Try again."); } else if (bground == "red") { document.bgColor="#ccceee" alert("No, not " + bground + ", too obnoxious! Try again."); } else { */ alert("The background color is now " +document.form1.colorbox.value+ "."); document.form1.colorbox.focus() document.form1.colorbox.select() /* } */ } </script> <TABLE BORDER=1 bordercolor=silver width="50%" cellpadding="0" CELLSPACING=0> <tr><td bgcolor="#face70"><center><br><FORM action="javascript:changeIt()" method=get name=form1><b>Change the background color! </b><INPUT maxLength=21 name=colorbox length="20">Â*<INPUT onclick=changeIt() type=button value="Change It!"> <br> </FORM></td></tr></table><p> |
|
#4
|
|||
|
|||
|
RE: php to html
thx, I tried fwrite/fopen and they seem to work. I´ll try the javascript solution too.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > php to html |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|