Web Advertising - Loan - Wordpress Themes - Winunited Bonuses - Myspace Layouts

PDA

View Full Version : I'm new and i would like some help please.


cip6791
Nov 8th 2007, 10:12 pm
I would like to call a javascript using php using a textarea and a submit button.

index.php
<form action="ad.php" method="post">
<p>
<textarea name="ad" rows="4" cols="45"></textarea>
</p>
<p><input type="submit" value="Update" /></p>
</form>
-------------------------------------------------------
ad.php
<?php

$ad = $_POST["ad"];
//$temp = "<b>fds</b>";

echo ($ad);

?>

when i paste a little javascript, let s say my google adsense script ... the php won t display it. Why? Can anybody help?


Thanks

CEHonline
Nov 9th 2007, 4:29 am
index.php
<form action="ad.php" method="post">
<p>
<textarea name="ad" rows="4" cols="45"></textarea>
</p>
<p><input type="submit" value="Update" /></p>
</form>
-------------------------------------------------------
ad.php
<?php

$advertisment = $_POST["ad"];

echo $advertisment;

?>

bartolay13
Nov 9th 2007, 4:53 am
what do you want to call from javascript??

you can write a javascript event, and call functions inside php..
onclick, onblur, etc..

here is my quick example script

<head>
<title>Untitled Document</title>
<script type="text/javascript">
function trial()
{
alert("ryan");
}
</script>
</head>

<body>
</body>
</html>


<?php
echo"<form id=\"form1\" name=\"form1\" method=\"post\" >
<label>
<input type=\"submit\" name=\"Submit\" value=\"Submit\" onclick=\"trial()\"/>
</label>
</form>";
?>