Heres what im attempting
Cant seem to get it to work.
http://www.tertuliadofado.com/conte...eworkdammit.php
The list isnt recognizing the variables.
The html form file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="form.php">
<select name="selectname">
<option selected>Get variables</option>
<option name="selectname1" value="text1">Get variable 1</option>
<option name="selectname2" value="text2">Get variable 2</option>
</select>
<br>
<textarea name="textareaname"></text>
<br>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
Form.php - the file that the html form executes.
<?
// this should be in the file that processes the form, ie: action=thisfile.php
/
use the list values to determine which file to use:
remember: you need to give your <SELECT> list a name and give each <OPTION> a value (in your example, "variable1" and "variable2" would be appropriate)
/
if($GET["textareaname"]=="text1" )$filename = "content.php";
else if($GET["textareaname"]=="text2" )$filename = "content.php";
else die("no variable selected" );
// update the file:
$ofile=fopen($filename,"w" );
fwrite($ofile,$_GET["textareaname"]);
fclose($filename);
// display confirm page:
header("Location: confirm.php" );
?>
content.php - the variables file
<?php
// Texto da pรกgina principal
$text1 = "text 1";
$text2 = "text 2";
?>