function tempdbentry()
{
var regex=/^[0-9A-Za-z]+$/; //^[a-zA-z]+$/
var myname = document.ItemEntryForm.iname.value;
var mycat = document.ItemEntryForm.selectcat.value;
var mypic = document.ItemEntryForm.ipic.value;
"<?php
$phpmyname = '?><script language=javascript>document.write(myname);</script><?php';
$phpmyname = str_replace('?>', '', $phpmyname);
?>"
"<?php
$phpmycat = '?><script language=javascript>document.write(mycat);</script><?php';
$phpmycat = str_replace('?>', '', $phpmycat);
?>"
"<?php
$phpmypic = '?><script language=javascript>document.write(mypic);</script><?php';
$phpmypic = str_replace('?>', '', $phpmypic);
?>"
if(regex.test(myname))
{
"<?php $query1 = "SELECT * FROM temp_item_details WHERE titem_name = '$phpmyname'"; ?>"
"<?php $result1 = mysql_query($query1); ?>"
if ( "<?php mysql_num_rows($result1); ?>" == 0 )
{
"<?php $query2 = "SELECT * FROM temp_item_details WHERE titem_image = '$phpmypic'"; ?>"
"<?php $result2 = mysql_query($query2); ?>"
if ( "<?php mysql_num_rows($result2); ?>" == 0 )
{
//Get rid of Hackers
"<?php $itemname=strip_tags($phpmyname); ?>"
"<?php $itemcatagory=strip_tags($phpmycat); ?>"
"<?php $itempicture=strip_tags($phpmypic); ?>"
//finally insert into database
"<?php $sql="INSERT INTO temp_item_details SET titem_name='$itemname',titem_catagory='$itemcatagory',titem_image='$itempicture'"; ?>"
"<?php $result = mysql_query($sql); ?>"
}
else
{
alert("Picture Already Exist for another Item");
return false
}
}
else
{
alert('item name already exist');
return false;
}
}
else
{
alert("Please Enter Alpha Numeric Value");
return false;
}
}
//-->
</script>
Hi there I am trying to run a simple logic but m completely paralized to assign javascript variable value to php variable value. I would be kind if someone direct me accordingly... thanks