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:
Odd request (2003)
pull downs (1997)
processing .html pages (2001)
Re:Variable Math (1998)
Re:2nd WebCatalog2 Feature Request (1996)
X etc.... (1999)
WebCat2b13MacPlugin - nested [xxx] contexts (1997)
WebCat2 - Getting to the browser's username/password data (1997)
WebCatalog/Mac 2.1b2 - PIXO (1997)
Date Bug (1998)
default value from Lookup (was Grant, please help me) (1997)
WebCat2b13MacPlugIn - syntax to convert date (1997)
more info on [setlineitems] (1997)
blank page from template (1997)
File not found error message (1998)
[WebDNA] agree? --> [url] broken inside [redirect], on a square-bracket-style include, included from a XML-style page (2009)
WebStar CGI Version (2005)
Help! (2000)
[OT] Redhat 6.1 (2003)
Quitting WebMerchant ? (1997)