PHP On Another Server
Posted: Wed Mar 02, 2011 8:01 am
Code: Select all
<form action="reviews.php" method="post" id="ReviewSubmission">
<p>Name:
<input name="Name" type="text" size="30" />
</p>
<p>Category:
<select name="Category">
<option value="Log Cabin">Log Cabin</option>
<option value="Caravan">Caravan</option>
<option value="Camping">Camping</option>
<option value="Romany Caravan">Romany Caravan</option>
<option value="Tipi">Tipi</option>
</select>
</p>
<p>Rating:
<select name="Rating">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5" selected="selected">5</option>
</select></p>
<p>Your Comments:
<textarea name="Comment" cols="45" rows="5"></textarea>
</p>
<p>
<input type="submit" name="submit" value="Submit Feedback" />
</p>
</form>
Code: Select all
<?php
$name = $_POST['Name'];
$cat = $_POST['Category'];
$rate = $_POST['Rating'];
$comment = $_POST['Comment'];
print"<p>Name: $name</p> <p>Category: $cat</p> <p>Rating: $rate</p> <p>Comment: $comment</p><hr width=100% />"
?>To make it easier, HTML is on server 1, PHP is on server 2. How can i get the form to submit to the PHP, then write a new file back in server 1. This is for a review page. Furthermore, the PHP overwrites the previous review, so how can I get it to ammend the form to the bottom of a page.
Thanks in advance.