PHP Form

Hi,
I'm very new to PHP so I'm looking for hints/ sample of how I can do the following

I need a simple front end where I would enter two variables in a form which will output the formatted results like below
variable1=test
variables=10.20.20.1

The formatted text will look like this and the whitespace will need to be taken into account

-------------------------------------
Place configuration as follows
Endpoint
      ,EndpointName=test
      ,EndpointIpAddress=10.20.20.1
--------------------------------------



   
waybooAsked:
Who is Participating?
 
Roger BaklundCommented:
Not sure if I understaood the requirements, but try this:
<html><head><title>front end</title>
</head><body>
<form>
<label>variable1
<input type="text" name="variable1" />
</label><br />
<label>variables
<input type="text" name="variables" />
</label><br />
<input type="submit" />
</form>
<?php
 
if(isset($_REQUEST['variable1'])) {
  echo "<pre>Place configuration as follows
Endpoint
      ,EndpointName=".$_REQUEST['variable1']."
      ,EndpointIpAddress=".$_REQUEST['variables'];
}
 
?>
</body>
</html>

Open in new window

0
 
Roger BaklundCommented:
There should be an ending </pre> tag:
echo "<pre>Place configuration as follows
Endpoint
      ,EndpointName=".$_REQUEST['variable1']."
      ,EndpointIpAddress=".$_REQUEST['variables'].'</pre>';

Open in new window

0
 
waybooAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.