?
Solved

PHP Form

Posted on 2009-04-27
3
Medium Priority
?
227 Views
Last Modified: 2012-05-06
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
--------------------------------------



   
0
Comment
Question by:wayboo
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 2000 total points
ID: 24246863
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
 
LVL 39

Expert Comment

by:Roger Baklund
ID: 24246870
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
 

Author Closing Comment

by:wayboo
ID: 31575267
Thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question