Hi, I'm using dreamweaver 8 and and i have created code that allowed me to insert data information in to the mysql server database.
And once insert into database, is redirect to other page at "thank you.php".
I also wrote a small javascripts that allowe me to slide background color where it said "thank you", the function called "thankyou()"
I like to change something that does not want to redirect to other page "thank youphp"after insert database, but I want to stay same page and instead of redirect to other page, i want to point to thank you() in javascripts in same page.
My question is that how can i change write code into javascript from inside of php code, please see code in BOLD, it said it will send to "thankyou.php" but on othr line (last line) under BOLD with underline is something that i want to change to javascripts to point to the function called "Thankyou()" how can write that code to point to the functio called "thankyou()" in javascrips!
please help me thanks.
AM
<?php require_once('../Connections/RegData.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $SERVER['PHP_SELF'];
if (isset($SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($POST["MM_insert"])) && ($POST["MM_insert"] == "myform")) {
$insertSQL = sprintf("INSERT INTO pol_emaillist (Name, Email) VALUES (%s, %s)",
GetSQLValueString($POST['name'], "text"),
GetSQLValueString($POST['email'], "text"));
mysql_select_db($database_RegData, $RegData);
$Result1 = mysql_query($insertSQL, $RegData) or die(mysql_error());
$insertGoTo = "../thankyou.PHP";
if (isset($SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}