Re: Web DNA...
This WebDNA talk-list message is from 2007
It keeps the original formatting.
numero = 68922
interpreted = N
texte = This is exactly why I don't want to switch to php:Clint Davis wrote:> I usually put this into a func.php file that I include into each page. Note> the line breaks that should all be one line.> > if (!function_exists("GetSQLValueString")) {> function GetSQLValueString($theValue, $theType,(LINEBREAK)> $theDefinedValue = "", $theNotDefinedValue = "") {> $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;> $theValue = function_exists("mysql_real_escape_string") ?(LINEBREAK)> mysql_real_escape_string($theValue) : mysql_escape_string($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;> }> }> ?>> > > Then, you can set your variables like this:> $myVariable = GetSQLValueString($_GET['Variable'],'text');> (your variable name) = GetSQLValueString(GET/POST depending ['Incoming> Variable Name'],'type of variable from function above');Frank-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
This is exactly why I don't want to switch to php:Clint Davis wrote:> I usually put this into a func.php file that I include into each page. Note> the line breaks that should all be one line.> > if (!function_exists("GetSQLValueString")) {> function GetSQLValueString($theValue, $theType,(LINEBREAK)> $theDefinedValue = "", $theNotDefinedValue = "") {> $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;> $theValue = function_exists("mysql_real_escape_string") ?(LINEBREAK)> mysql_real_escape_string($theValue) : mysql_escape_string($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;> }> }> ?>> > > Then, you can set your variables like this:> $myVariable = GetSQLValueString($_GET['Variable'],'text');> (your variable name) = GetSQLValueString(GET/POST depending ['Incoming> Variable Name'],'type of variable from function above');Frank-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Frank Nordberg
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
XMLNodes Error (2007)
Can't load tmpl files (1997)
is [Bankres] an internal webcat variable? (1999)
Delete Context - to remove record (1998)
!@#$$@@# formulas database, tax and freight. (2002)
Safe command=append (1999)
Grep -Replace with nothing (2003)
WebCat2.0 [format thousands .0f] no go (1997)
New WebCatalog Version !!! (1997)
Include Troubles (1998)
shownext problems (1998)
Form Variables (2000)
Pop-Up Redirects (1998)
Using Plug-In while running 1.6.1 (1997)
Problems with [Search] param - Mac Plugin b15 (1997)
Hiding HTML and breaking the page (1997)
WebDNA 6.1 Back Button Issue (2004)
2cd pair of eyes (2003)
RED QUESTION MARKS AGAIN (1999)
[BULK] RE: [WebDNA] WebDNA for Windows Newbie Questions (2008)