flo
02-22-2008, 07:50 AM
Ok...so i'm new to this one....be gentle please :)
I got wamp 2.0 server, i install it, follow the steps very easy until here also...made some modification in php.ini and in httpd.conf
The icon from the wamp server it's white and the services are running
Now the tricky part :)
I have a functionally site and i got also his data base.
I copy the site files in the directory C:\wamp\www\bbbb(made a folder)
In phpMyadmin i created a new user (same as the one from db.php
<?
function openCN($dsn='zzzzz:*****@localhost/bbbbb'){
ereg('^([^:]+):([^@]+)@([^/]+)/([^\\/:*?."<>|]+)$',$dsn,$regs) or die('invalid dsn format');
@mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
@mysql_select_db($regs[4]) or die('no such database');
mysql_query( "SET CHARACTER SET 'utf8'" );
}) and a data base with the same name. I imported the data base and everything it's fine until here.
:( But when i type in my local browser http://localhost/bbbb in my browser window it displays:
|]+)$',$dsn,$regs) or die('invalid dsn format'); @mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
@mysql_select_db($regs[4]) or die('no such database');
mysql_query( "SET CHARACTER SET 'utf8'" ); } function closeCN(){ mysql_close(); } function sqlInsert($t,$a){ if(!is_array($a))return(FALSE);
$s=NULL; foreach($a as $k=>$v){ if($s){$s.=",";$s2.=",";}else{$s="INSERT INTO `$t`(";$s2="";} $s.="`$k`";if($v===NULL)$s2.="NULL";else $s2.="'".addslashes($v)."'"; }
return("$s) VALUES($s2)"); } function sqlUpdate($t,$a){ if(!is_array($a))return(FALSE); $s=NULL; foreach($a as $k=>$v){ if($s)$s.=",";else $s="UPDATE `$t` SET "; $s.="`$k`=";if($v===NULL)$s.="NULL";else $s.="'".addslashes($v)."'"; } return($s); } ?>$val){ if($qs=='')$qs='?';else $qs.='&'; $qs.=$key.'='.$val; } return substr($_SERVER[PHP_SELF],strrpos($_SERVER[PHP_SELF],'/')+1).$qs; } function strBegin($s,$l=125){ if(strlen($s)>$l){ $s=substr($s,0,$l);
$s=substr($s,0,strrpos($s,' ')); $s.=' [...]'; } return $s; } function r_HTML($s,$l=NULL){ if($l!==NULL)$s=$l.'/'.$s; $tpl=new tpl($s);
return $tpl->get(); } function r_TXT($s){ /* $s=htmlspecialchars($s); $s=str_replace('<b>','',$s); $s=str_replace('<B>','',$s); $s=str_replace('</b>','',$s); $s=str_replace('</B>','',$s); */ $s=ereg_replace('[_a-zA-z0-9\-]+(\.[_a-zA-z0-9\-]+)*\@[_a-zA-z0-9\-]+(\.[a-zA-z]{1,6})+','\\0',$s); $s=nl2br($s); return $s; } function r_IMG($i,&$w,&$h,$u=NULL,$t=NULL){ global $g_strLang,$g_arrPreload; $imagesize=@getimagesize($i); $w=NULL; if($imagesize===FALSE)return NULL; list($width,$height,$type,$attr)=$imagesize;
if(NULL===$u)$s=''; else{ $s=''; $g_arrPreload[]=str_replace('.','_.',$i); } $w=$width; $h=$height; return $s; } function r_MEDIA($i,$w=NULL,$h=NULL,$bg=NULL){ if(eregi(".(jpg|jpeg|gif)$",$i)){ if((NULL===$w)&&(NULL===$h)){ $imagesize=@getimagesize($i); list($w,$h,$type,$attr)=$imagesize; } return(''); }
if(eregi(".swf$",$i)){ if((NULL===$w)&&(NULL===$h)){
From the Apache error.log i have the following:
[Fri Feb 22 09:18:09 2008] [error] [client 127.0.0.1] File does not exist:
C:/wamp/www/bbbb/'.$i.', referer: http://localhost/bbbb/
And also from php eror.log i have:
[22-Feb-2008 09:18:09] PHP Fatal error: Call to undefined function openCN() in
C:\wamp\www\bbbb\index.php on line 27
To mentioned that in the file index.php on line 27 i have
openCN();
:(:( any help???
Thanks,
I got wamp 2.0 server, i install it, follow the steps very easy until here also...made some modification in php.ini and in httpd.conf
The icon from the wamp server it's white and the services are running
Now the tricky part :)
I have a functionally site and i got also his data base.
I copy the site files in the directory C:\wamp\www\bbbb(made a folder)
In phpMyadmin i created a new user (same as the one from db.php
<?
function openCN($dsn='zzzzz:*****@localhost/bbbbb'){
ereg('^([^:]+):([^@]+)@([^/]+)/([^\\/:*?."<>|]+)$',$dsn,$regs) or die('invalid dsn format');
@mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
@mysql_select_db($regs[4]) or die('no such database');
mysql_query( "SET CHARACTER SET 'utf8'" );
}) and a data base with the same name. I imported the data base and everything it's fine until here.
:( But when i type in my local browser http://localhost/bbbb in my browser window it displays:
|]+)$',$dsn,$regs) or die('invalid dsn format'); @mysql_connect($regs[3],$regs[1],$regs[2]) or die('could not connect');
@mysql_select_db($regs[4]) or die('no such database');
mysql_query( "SET CHARACTER SET 'utf8'" ); } function closeCN(){ mysql_close(); } function sqlInsert($t,$a){ if(!is_array($a))return(FALSE);
$s=NULL; foreach($a as $k=>$v){ if($s){$s.=",";$s2.=",";}else{$s="INSERT INTO `$t`(";$s2="";} $s.="`$k`";if($v===NULL)$s2.="NULL";else $s2.="'".addslashes($v)."'"; }
return("$s) VALUES($s2)"); } function sqlUpdate($t,$a){ if(!is_array($a))return(FALSE); $s=NULL; foreach($a as $k=>$v){ if($s)$s.=",";else $s="UPDATE `$t` SET "; $s.="`$k`=";if($v===NULL)$s.="NULL";else $s.="'".addslashes($v)."'"; } return($s); } ?>$val){ if($qs=='')$qs='?';else $qs.='&'; $qs.=$key.'='.$val; } return substr($_SERVER[PHP_SELF],strrpos($_SERVER[PHP_SELF],'/')+1).$qs; } function strBegin($s,$l=125){ if(strlen($s)>$l){ $s=substr($s,0,$l);
$s=substr($s,0,strrpos($s,' ')); $s.=' [...]'; } return $s; } function r_HTML($s,$l=NULL){ if($l!==NULL)$s=$l.'/'.$s; $tpl=new tpl($s);
return $tpl->get(); } function r_TXT($s){ /* $s=htmlspecialchars($s); $s=str_replace('<b>','',$s); $s=str_replace('<B>','',$s); $s=str_replace('</b>','',$s); $s=str_replace('</B>','',$s); */ $s=ereg_replace('[_a-zA-z0-9\-]+(\.[_a-zA-z0-9\-]+)*\@[_a-zA-z0-9\-]+(\.[a-zA-z]{1,6})+','\\0',$s); $s=nl2br($s); return $s; } function r_IMG($i,&$w,&$h,$u=NULL,$t=NULL){ global $g_strLang,$g_arrPreload; $imagesize=@getimagesize($i); $w=NULL; if($imagesize===FALSE)return NULL; list($width,$height,$type,$attr)=$imagesize;
if(NULL===$u)$s=''; else{ $s=''; $g_arrPreload[]=str_replace('.','_.',$i); } $w=$width; $h=$height; return $s; } function r_MEDIA($i,$w=NULL,$h=NULL,$bg=NULL){ if(eregi(".(jpg|jpeg|gif)$",$i)){ if((NULL===$w)&&(NULL===$h)){ $imagesize=@getimagesize($i); list($w,$h,$type,$attr)=$imagesize; } return(''); }
if(eregi(".swf$",$i)){ if((NULL===$w)&&(NULL===$h)){
From the Apache error.log i have the following:
[Fri Feb 22 09:18:09 2008] [error] [client 127.0.0.1] File does not exist:
C:/wamp/www/bbbb/'.$i.', referer: http://localhost/bbbb/
And also from php eror.log i have:
[22-Feb-2008 09:18:09] PHP Fatal error: Call to undefined function openCN() in
C:\wamp\www\bbbb\index.php on line 27
To mentioned that in the file index.php on line 27 i have
openCN();
:(:( any help???
Thanks,