Jump to content

Recommended Posts

hi all i need help big time lol

 

Ive been trying to fix this for days but am well stuck  :-\

 

what it is i have created a simple php form that sends the information submitted in the form to another php page.

 

i have added a WYSIWYG html editor to the textarea form so i can send html to the next page.

 

it all works fine what ever i create in the WYSIWYG form gets sent to the next page.

 

The problem is if i add any links or images to the WYSIWYG form when there sent to the other side they get messed up and the links are wrong and the images don't show up.

 

this is what it does to a link . the link should be http://www.ebay.com/ but it turns it to http://pmb-web-designs.co.uk/%22http://www.ebay.com/%22

 

and the image html should be <IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300>

 

but it turns it to

<IMG class=screenshot height=240 alt=\"Earth Hour website\" src=\"http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg\" width=300>

 

why is that ?? and how do i fix it ???

 

a live demo can be seen here http://pmb-web-designs.co.uk/test/test.html

 

please please please some one help thanks from Patrick

Link to comment
https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/
Share on other sites

test didn't show a WYSIWYG  but i pasted in

<IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300> 

 

and the quotes were escaped but other than that it should of worked, no prefix of the domain name

 

without seeing any code i would guess your using addslashes(); or have magic quotes on

test didn't show a WYSIWYG  but i pasted in

<IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300> 

 

and the quotes were escaped but other than that it should of worked, no prefix of the domain name

 

without seeing any code i would guess your using addslashes(); or have magic quotes on

 

It should have shown WYSIWYG it does when i click on it, sorry dont understand your reply? am trying to send what every i put in the textarea form to show up on the next page. but it changes the html of links and images. how do i stop this??? the code i have used is below

 

 

test.html

 <html>

<head>
<script language="JavaScript" type="text/javascript" src="wysiwyg.js"></script>
<title></title>


<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
		<body background="">

<center>
<table height="100%" cellSpacing="0" cellPadding="0" width="980" border="0" id="table1">
<tr>
	<td width="965" background="" bgColor="#ffffff">
	<div align="center">
		<table height="145" cellSpacing="0" cellPadding="0" width="980" border="0" id="table2">
			<tr>
				<td width="978" height="27">
				<p align="left"></td>
			</tr>
		</table>
	</div>
	</td>
</tr>
<tr>
	<td width="978" bgColor="#ffffff">
	<div align="center">
		<table height="325" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table3">
			<tr>
				<td width="88%" background="" height="209">
				<div align="center">
					<table height="1" cellSpacing="0" cellPadding="0" width="980" border="0" id="table4">
						<tr>
							<td vAlign="top" width="974" height="1" background="">
							<div align="center">
								<table cellSpacing="0" cellPadding="0" width="969" border="0" id="table5" height="421">
									<tr>
										<td width="205" valign="top">
										<div align="center">
											<table border="0" width="169" cellspacing="0" cellpadding="0" id="table6">
												<tr>
													<td>
													<font face="Verdana" size="2" color="#333333">
													<p align="left"> </td>
												</tr>
											</table>
										</div>
										<p>
										<html>
<body bgcolor="#FFFFFF" leftMargin=10 topMargin=10 marginheight="10" marginwidth="10" >



</body>
</html></td>

										<td width="571" valign="top">
										<font face="Verdana" color="#333333" size="2">
										<form action="listing2.php" method="POST" target="_blank">


</div><b>Item Title</b><br>
<input type="text" name="itemtitle" size=40>
<p><b>Item Description</b><br>
<textarea cols=68 rows=15 name="message"></textarea><script language="JavaScript">
  generate_wysiwyg('message');
</script> 
<p><input type="submit" value=" Create"></td>

										<td width="193" valign="top">
										<div align="center">
											<table border="0" width="169" cellspacing="0" cellpadding="0" id="table7">
												<tr>
													<td> </td>
												</tr>
											</table>
										</div>
										<p> </td>

									</tr>
									</table>
							</div>
							</td>
						</tr>
					</table>
				</div>
				</td>
			</tr>
			<tr>
				<td width="88%" height="19"> </td>
			</tr>
		</table>
	</div>
	</td>
</tr>
<tr>
	<td width="978">
	</td>
</tr>
</table>
</center>

</body>

</html>

 

 

listing2.php

<?php

/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$itemtitle = $HTTP_POST_VARS['itemtitle'];
$a = $HTTP_POST_VARS['a'];
$message = $HTTP_POST_VARS['message'];

?>

<?php echo $itemtitle ?><p>
                    
<?php echo $message ?>

 

please help :)

try this

 

<?php

/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$itemtitle = $HTTP_POST_VARS['itemtitle'];
$a = $HTTP_POST_VARS['a'];
$message = $HTTP_POST_VARS['message'];

//magic quotes fix
$message= (get_magic_quotes_gpc())?stripslashes($message):$message;
}

?>

<?php echo $itemtitle ?><p>
                    
<?php echo $message ?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.