amritags Posted June 24, 2011 Share Posted June 24, 2011 Hai all, I want to retrieve the contents of a paragragh in html file to php file...... Is there a way to do this?? I tried the code below................................ html file <!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>newdictionary</title> </head> <body> <form name="f" action="newdictionary.php" method="post"> <p name="p">This is a paragraph</p> <input type="submit" /> </form> </body> </html> newdictionary.php <?php $name=$_POST["p"]; echo $name; ?> How can i get this????Someone help........ Link to comment https://forums.phpfreaks.com/topic/240294-how-to-get-the-contents-inside-tag-of-an-html-file-into-a-php-file/ Share on other sites More sharing options...
AMcHarg Posted June 24, 2011 Share Posted June 24, 2011 Why do you want to do that? Why not just use a <textarea></textarea>? Your method will not allow users to edit the contents of the <p>, and as a result what's the point in posting a value that you already know? Link to comment https://forums.phpfreaks.com/topic/240294-how-to-get-the-contents-inside-tag-of-an-html-file-into-a-php-file/#findComment-1234245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.