How can I pass html from one page to another?
I know how to pass simple values:
<input type="hidden" value="test" />
But when passing html in the value, for example a table:
<input type="hidden" value="<table><tr><td>test</td></tr></table>" />
it prints the table.
Any idea?
Passing html from one page to another
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: Passing html from one page to another
What if you equate the html code you want to sent to a variable and pass that along?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing html from one page to another
htmlentities(), then html_entity_decode() on the receiving page if you need to.klevis miho wrote:How can I pass html from one page to another?
I know how to pass simple values:
<input type="hidden" value="test" />
But when passing html in the value, for example a table:
<input type="hidden" value="<table><tr><td>test</td></tr></table>" />
it prints the table.
Any idea?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Passing html from one page to another
Thank you, I've tried both of the functions.
But there was a problem when the html file contained double quotes.
I've came around this problem by replacing the double qoutes with a character like "#", then replaced them back to double quotes.
But there was a problem when the html file contained double quotes.
I've came around this problem by replacing the double qoutes with a character like "#", then replaced them back to double quotes.
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing html from one page to another
I don't know what problem you had with double quotes, but did you look at the arguments for these functions?
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.