Hi D Dave, I don't know anything about "NCServer" but it kind of sounds like you don't have php installed. Chris P.S. What does your new call to postURL with php file look like?
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of deeti_dave Sent: Donnerstag, 11. August 2005 18:12 To: [email protected] Subject: [svg-developers] Re: how to write to a file using posturl() Dear Chris, I am trying to post to url very simple data, but all I get is alert(urlRequestStatus.content); from the peice of code below: function MyObj(msg) { this.msg = msg } MyObj.prototype.operationComplete = function(urlRequestStatus) { if(urlRequestStatus.success) { alert('success!!'); if (urlRequestStatus.content!=null) { alert(urlRequestStatus.content); } } } which shows whole php file content. Would some mismatch with my webserver, as I am not using standardized webserver, I have NCServer, which is an ISV webserver. I would really appreciate it if you can enlighten me a li'l bit more... D Dave --- In [email protected], "Chris Peto" <[EMAIL PROTECTED]> wrote: > HI DD, > > Best way is to post to a server scripting, i.e. PHP: > > function MyObj(msg) { this.msg = msg } > MyObj.prototype.operationComplete = function(urlRequestStatus) > { > > //alert(this.msg+" "+status); > //alert(this.msg+" "+urlRequestStatus); > if(urlRequestStatus.success) > { > //alert('success'); > if (urlRequestStatus.content!=null) > { > alert(urlRequestStatus.content); > GraphicChanged = false; > } > } > > } > > > var fd = null; > var filename = "NoName.svg"; > function saveFileOk(file,email,fileshort) { > //alert(email); > var content = glist.getSave(); > //alert(content); > postURL("savefile.php? filename="+file+"&email="+email,content, new > MyObj("My message:")); > //filename = fileshort; > } > > > savefile.php: > > <?php > extract($HTTP_GET_VARS); > extract($HTTP_POST_VARS); > > //$filename="./user/nothing"; > //input $file > // $HTTP_RAW_POST_DATA from posturl > if(!preg_match("/.svg/",$filename)) $filename.=".svg"; > //a little security > //$filename = ereg_replace("\.\./", "",$filename); > echo ("Filename: ".$filename." "); > if(preg_match("/\.\/user\//",$filename) || > preg_match("/\.\.\/svgeditor\/user\//",$filename)) { > if($fp = fopen($filename,"wb+")) { > fputs($fp,'<?xml version="1.0" encoding="iso-8859-1"?>'); > //fputs($fp,"\n<svg width=\"100%\" height=\"100%\">"); > fputs($fp,$HTTP_RAW_POST_DATA); > //fputs($fp,"\n</svg>"); > fclose($fp); > > echo("File write succeded:"); > if($email != "") { > $message = '<?xml version="1.0" encoding="iso-8859-1"?>'; > $message .= "\n<svg width=\"100%\" height=\"100%\">"; > $message .= $HTTP_RAW_POST_DATA; > $message .= "\n</svg>"; > mail($email,"Your svg from Resource Solutions",$message,"From: > [EMAIL PROTECTED]"); > if($lfp = fopen("savelogfile.log","a+")) { > $strout = sprintf("Email: %s IP: %s writing file %s on > %s",$email,$REMOTE_ADDR,$filename,date("d.M.Y, G:m:s", time())); > fputs($lfp,$strout); > fputs($lfp,"\n"); > fclose($lfp); > } > } > else { > if($lfp = fopen("savelogfile.log","a+")) { > $strout = sprintf("IP: %s writing file %s on > %s",$REMOTE_ADDR,$filename,date("d.M.Y, G:m:s", time())); > fputs($lfp,$strout); > fputs($lfp,"\n"); > fclose($lfp); > } > } > } > else > echo("File create failed:"); > } > else > echo ("Nice try!"); > ?> > > > > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of deeti_dave > Sent: Mittwoch, 10. August 2005 23:11 > To: [email protected] > Subject: [svg-developers] how to write to a file using posturl() > > > Dear all, > > I'm back again with question! > I am using different ways to post some data to an html page: > > function display_vol(evt){ > var vol = js_arr[0]; > > svgdoc = evt.target.ownerDocument; > alert("before postURL()"); > var somevar = 'In SVG'; > //postURL('svgWrite.html&avol='+vol,somevar ,callback); > //postURL("svgWrite.html?avol=",vol ,callback); > //postURL("svgWrite.html" ,"avol="+vol ,callback); > postURL("svgWrite.html?avol="+vol,vol ,callback); > > } > > > function callback(obj){ > var string = ''; > if(obj.success){ > alert("success!"); > string = obj.content; > alert(string); > > > }else{ > alert("request failed !"); > } > } > > > > I tried all the ways commented in the code above to post some data, > but in html I can not get that value when I run this code. Plese, I > would really appreciate it if I can get some guidance.. > > Thank you > DD > > > > > > ----- > To unsubscribe send a message to: > [EMAIL PROTECTED] > -or- > visit http://groups.yahoo.com/group/svg-developers and click "edit my > membership" > ---- > > > > _____ > > YAHOO! GROUPS LINKS > > > > * Visit your group "svg-developers > <http://groups.yahoo.com/group/svg-developers> " on the web. > > > * To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED] subject=Unsubscribe> > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/> . > > > _____ > > > > > [Non-text portions of this message have been removed] ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- _____ YAHOO! GROUPS LINKS * Visit your group "svg-developers <http://groups.yahoo.com/group/svg-developers> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . _____ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hr1jk61/M=362335.6886445.7839731.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1123843626/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

