Quantcast
Channel: Adobe Community : All Content - PHP Application Development (read only)
Viewing all articles
Browse latest Browse all 107

Is it possible to dynamically create html elements using php? (See attached example)

$
0
0

I'm trying to dynamically output the number "1" each time i click the submit button but without deleting the previous result which is  ("1") . For example: If i click ten times the submit button i should have ten 1s.

 

This is what im trying to output each time i click the submit button. Any help would be appreciated.

 

 

Dynamically1.jpg

 

 

 

This code is just an example.

 


<!-- PHP Code  -->

 

<?php

 

if( $_SERVER['REQUEST_METHOD']  ==  'POST' ){

 

$i = 1;

 

if ( $i ) {

echo $i ;

 

}

 

}
?>

 

<!-- HTML Code  -->

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

 

<body>

 

<form action="" name="myForm" method="POST">

 

<input type="submit" value="Submit"/>

 

</form>

 


</body>
</html>


Viewing all articles
Browse latest Browse all 107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>