Jump to content

shamuntoha

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by shamuntoha

  1. Ok getting as following: Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for [email protected] in C:\Inetpub\wwwroot\OTHERS\hbc\test.php on line 5 not ok
  2. no error showing up, only showing "not ok". <?php if(mail('[email protected]','test subject','test message')) { echo('ok'); }else{ echo('not ok'); } ini_set ("display_errors", "1"); error_reporting(E_ALL); ?>
  3. Running windows 2003, Apache, PHP 5.0.3: why the following script showing not ok. What could be missing error or setup? php.ini: [mail function] ; For Win32 only. SMTP = anotherSMTP.domain.net smtp_port = 25 ; For Win32 only. sendmail_from = [email protected] cdoe: <?php if(mail([email protected]','test subject','test message')) { echo('ok'); }else{ echo('not ok'); } ?>
  4. Working with this: http://www.fpdf.org/ Great job.... 1. GD enable. 2. php_pdf.dll and following code.... <?php require('../fpdf.php'); class PDF extends FPDF { //Page header function Header() { //Logo $this->Image('logo_pb.png',10,8,300, 500); //Arial bold 15 $this->SetFont('Arial','B',15); //Move to the right $this->Cell(80); //Title $this->Cell(30,10,'Title',1,0,'C'); //Line break $this->Ln(20); } //Page footer function Footer() { //Position at 1.5 cm from bottom $this->SetY(-15); //Arial italic 8 $this->SetFont('Arial','I',; //Page number $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } } //Instanciation of inherited class $pdf=new PDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Times','',12); for($i=1;$i<=40;$i++) $pdf->Cell(0,10,'Printing line number '.$i,0,1); $pdf->Output(); ?>
  5. Where should be the fatal error ? C/C++ Manual Function prototype: int PDF_load_image(PDF *p, const char *imagetype, const char *filename, int reserved, const char *optlist) void PDF_fit_image(PDF *p, int im, float x, float y, const char *optlist) void PDF_close_image(PDF *p, int image) PHP Trying : //PDF *p; $pdf = PDF_new(); $image = PDF_load_image($pdf, "jpeg", "c:\picture.jpg", 0); PDF_fit_image($pdf, $image, 1.5, 1.5, "scale 0.5"); PDF_close_image($pdf, $image);
  6. Any idea how to fix it? $image is having the problem. PHP: 5.0.3: Fatal error: Uncaught exception 'PDFlibException' with message 'Handle parameter 'image' has bad value 0' in C:\Inetpub\wwwroot\tst.php:35 Stack trace: #0 C:\Inetpub\wwwroot\tst.php(35): pdf_fit_image(Resource id #2, 0, 10, 10, 'scale 0.5') #1 {main} thrown in C:\Inetpub\wwwroot\tst.php on line 35 Code: if (($image = PDF_load_image($pdf, "jpeg", "C:\Inetpub\wwwroot\img\addcallback.JPG", 0)) == -1) { fprintf(stderr,"Error: Couldn't read image file.\n"); } else { PDF_fit_image($pdf, $image, 10, 10, "scale 0.5"); PDF_close_image($pdf, $image); }
  7. Attached the file example. Background image with logo and table borders shape, and Black lines are database values. How we do this ? [attachment deleted by admin]
  8. I have a php code running, i can create pdf file with text informations for the moment only. But how can i embed a A4 background image gif, jpg, etc. And in front of the background apply the following text ? Any reference? <?php /* * This is an example of my first PDF test * Worked by NuSphere PHPed * Manualy downloaded library from * http://pecl4win.php.net/ext.php/php_pdf.dll */ /* * Stage - 1 * Resource create for PDF library */ $pdf = PDF_new(); /* * Stage - 2 * Save where? Path to create the file. */ pdf_open_file($pdf, "d:\heloworld.pdf"); /* * Stage - 3 * Page diemention (A4) */ pdf_begin_page($pdf, 595, 842); /* * Stage - 4 * path of your TTF font directory * can also use pdf_load_font(); * http://uk3.php.net/manual/en/function.pdf-findfont.php */ $fontdir = "C:\WINDOWS\Fonts"; pdf_set_parameter($pdf, "FontOutline", "arialMyName=$fontdir\arial.ttf"); $arial = PDF_findfont($pdf,"arialMyName","host",0 ); /* * Stage - 5 * Set font size and font name */ pdf_setfont($pdf, $arial, 10); /* * Stage - 6 * print text */ pdf_show_xy($pdf, "Hellow World? ",50, 750); pdf_show_xy($pdf, "Test 1, 2, 3, 4 working. ", 50,730); /* * Stage - 7 * end page */ pdf_end_page($pdf); /* * Stage - 8 * close and save file */ pdf_close($pdf); ?>
  9. How to compile this ? PHP GTK? , do we have any forums for this ? <? $ret = win_messagebox('Welcome to the Roadsend Compiler', PCC_VERSION_TAG, MB_YESNOCANCEL|MB_ICONASTERISK); switch ($ret) { case IDYES: win_messagebox("You answered Yes",'Go'); break; case IDNO: win_messagebox("You answered No", 'Stop'); break; case IDCANCEL: win_messagebox("You answered Cancel", "Cancel"); break; } $install_dir = win_get_registry_key(HKEY_LOCAL_MACHINE, "SOFTWARE\\Roadsend\\Compiler\\". PCC_VERSION_MAJOR.'.'. PCC_VERSION_MINOR, "root"); win_messagebox("The Roadsend install dir is [" .$install_dir."]\n",'Version'); echo "last error: ".win_getlasterror(); ?>
  10. Any idea why getting a error while select, insert, using few stored procedure. Exception "trying to fetch row:null" select destno,duration,compid,agentid, @sab:=(select subsubcomp from users where users.ugroup='reseller' and users.agentid=cdr.agentid and users.compid=cdr.compid limit 1) sb, @scd:=(select rateid from subrcomp where subrcomp.agentid=cdr.agentid and subrcomp.balance2=@sab) sa, (case when @sab is NULL then @sr1:=substring_index(substring_index(@sw1:=concat(0,',',0,',',0), ',', 1), ',', -1) else (case when @scd is NULL then @sr1:=substring_index(substring_index(@sw1:=concat(0,',',0,',',0), ',', 1), ',', -1) else @sr1:=substring_index(substring_index(@sw1:=f_subrrate(cdr.agentid,@sab,@scd,cdr.destno), ',', 1), ',', -1) end) end) sRCollecting, @sr2:=substring_index(substring_index(@sw1, ',', 2), ',', -1) RSetup,@sr3:=substring_index(substring_index(@sw1, ',', 3), ',', -1) sRRate,concat((@sr3+@sr1)*duration/60+@sr2) as sRcost from cdr where cdr.date='2008-08-09' and cdr.duration>0 and convert(destno, SIGNED INTEGER) is not null; insert ignore into SlaveCdr (vtemp4,vtemp3,vtemp2,vtemp1,CDRID,CDRTIME,COMPID,Duration,Switch,Time,Date,PIN,DestNo,LineOut,CarrierOut,CallRate, CallCost, DNIS, BalLeft, CarrierIn, LineIn, Cause,CLI,slavecdr.AgentId, BatchId, ExpiryDate,Temp5,BuyCollecting ,BuySetup, BuyRate,BuyCost,Temp3,OwnCollecting,OwnSetup,OwnRate,OwnCost,Temp4,vcollecting,vsetup,vrate,vcost,Outboundno,Blegzone,Blegrateid,slavecdr.ID,vtemp5) select @ab:=NULL,@ef:=NULL,@ij:=NULL,concat(@cd:=NULL,@b1:=NULL,@b3:=NULL,@r1:=NULL,@r3:=NULL,@p1:=NULL,@p3:=NULL,@v1:=NULL,@w1:=NULL,@y1:=NULL),CDRID,CDRTIME,COMPID,Duration,Switch,Time,Date,PIN,DestNo,LineOut,CarrierOut,CallRate , CallCost, DNIS, BalLeft, CarrierIn, LineIn, Cause,CLI,cdr.AgentId, BatchId, ExpiryDate, @ij:=(select agentid from srcomp where srcomp.agentid=cdr.agentid limit 1) temp5, (case when @ij is null then @b1:=substring_index(substring_index(@v1:=concat(0,',',0,',',0), ',', 1), ',', -1) else @b1:=substring_index(substring_index(@v1:=f_srrate(cdr.agentid,destno), ',', 1), ',', -1) end) BuyCollecting, @b2:=substring_index(substring_index(@v1, ',', 2), ',', -1) BuySetup, @b3:=substring_index(substring_index(@v1, ',', 3), ',', -1) BuyRate, concat((@b3+@b1)*duration/60+@b2) as BuyCost, (select (case when find_in_set(left(cdr.time,2),bcomp.hours) is null then @ef:=NULL else @ef:=bcomp.rateid end) from bcomp where bcomp.carrier=cdr.carrierout and bcomp.node=cdr.outboundno and not find_in_set(left(cdr.time,2),bcomp.hours)='0' limit 1) Tmp3, (case when @ef is NULL then @o1:=substring_index(substring_index(@x1:=concat(0,',',0,',',0), ',', 1), ',', -1) else @o1:=substring_index(substring_index(@x1:=f_brate(@ef,cdr.destno), ',', 1), ',', -1) end) OCollecting, @o2:=substring_index(substring_index(@x1, ',', 2), ',', -1) OSetup,@o3:=substring_index(substring_index(@x1, ',', 3), ',', -1) ORate,concat((@o3+@o1)*duration/60+@o2) as Ocost, (select (case when find_in_set(left(cdr.time,2),vcomp.hours) is null then @gh:=NULL else @gh:=vcomp.rateid end) from vcomp where vcomp.agentid=cdr.agentid and vcomp.carrier=cdr.carrierout and vcomp.node=cdr.outboundno and not find_in_set(left(cdr.time,2),vcomp.hours)='0' limit 1) Tmp4, (case when @gh is NULL then @p1:=substring_index(substring_index(@y1:=concat(0,',',0,',',0), ',', 1), ',', -1) else @p1:=substring_index(substring_index(@y1:=f_vrate(cdr.agentid,@gh,cdr.destno), ',', 1), ',', -1) end) vcollecting, @p2:=substring_index(substring_index(@y1, ',', 2), ',', -1) vsetup,@p3:=substring_index(substring_index(@y1, ',', 3), ',', -1) pRate,if(@p1<>0 or @p2<>0 or @p3<>0 and cdr.duration>0,(case when ((@p3+@p1)*duration/60+@p2)<=1 then 1 else concat((@p3+@p1)*duration/60+@p2) end),0) vcost, Outboundno,cdr.Blegzone,cdr.Blegrateid,cdr.ID,@gh:=NULL from cdr where cdr.date='2007-10-10' and cdr.duration>0 and convert(destno, SIGNED INTEGER) is not null;
  11. Keeping as backup for reference AJAX standard for quick uses. /** * @xmlHttp used to ajax handle * -------------------------------------------- * Default STandard use */ var xmlHttp; /** * @ajax_maincall * Call this from your HTML events */ function ajax_main(){ // Create ajax ajax_connect(2,2,3,4); /* * Start auto reload * In case of real time data query * Optional */ ajax_listen(); } /** * @GetXmlHttpObject used to detect the browser * Supported - Firefox, Opera , Safari, IE * */ function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } /** * @ajax_connect * Use query mysql data or other * by php, asp, jsp */ function ajax_connect(str1, str2, str3, str4){ // Set xmlHttp object for browser xmlHttp=GetXmlHttpObject(); // Condition for browser if (xmlHttp==null){ alert ("This browser does not support AJAX!"); return; } /* * Variable setup for php or asp or jsp */ var url="username_password_others.php"; url=url+"?str1="+str1+"&str2="+str2+"&q3="+str3+"&q4="+str4; // Must be used , dont change for caching url=url+"&sid="+Math.random(); /* * Call output event * Query output represent * *condition can be removed */ if(str1=="2"){ xmlHttp.onreadystatechange=ajax_dataarival1; }else{ xmlHttp.onreadystatechange=ajax_dataarival2; } // Execute GET method xmlHttp.open("GET",url,true); // Send Get or Post method xmlHttp.send(null); } /** * @ajax_dataarival1 * Login failure * */ function ajax_dataarival1(){ if (xmlHttp.readyState==4){ // Will replace the mother page. // html: <div id="s1"> replace me </div> $tim = time(); document.getElementById("s1").innerHTML=$tim; } } /** * @ajax_dataarival2 * Login failure * */ function ajax_dataarival2(){ if (xmlHttp.readyState==4){ // Will replace the mother page. // html: <div id="s2"> replace me </div> $tim = time(); document.getElementById("s2").innerHTML=$tim; } } /** * @ajax_listen * Timer to ping and pong * Optional timer */ var tImer; function ajax_listen(){ ajax_connect(1,2,3,4); cOunter=cOunter+1; tImer=setTimeout("ajax_listen()",1000); }
  12. First test if those two following working for your browsers. You need to follow the HTML and JAvascript standards for getElementById javascript: document.getElementById("s1").innerHTML="Overwrite IE,FF,Opera"; html: <div id="s1">Ready</div>
  13. Maybe this way you can do also? per second it call a function. ajax_main(1,2,3,4); /** * @xmlHttp used to detect the browser object * related pages * -------------------------------------------- * Basic standard useing */ var xmlHttp; /** * @ajax_maincall * Call this from your HTML event */ function ajax_maincall(){ // create ajax object ajax_main(2,2,3,4); // Start auto reload ajax_listen(); } /** * @GetXmlHttpObject used to detect the browser and set * xmlHttp * Firefox, Opera , Safari, IE */ function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } /** * @ajax_main used inside the html action events * Function to be called from the main pages. * ajax_main(option1, option2, option3, option4) * example: * ajax_main( price.options[price.selectedIndex].value + ' ' + this.options[this.selectedIndex].value ); * */ function ajax_main(str1, str2, str3, str4){ // Set xmlHttp object for browser xmlHttp=GetXmlHttpObject(); // Condition for browser if (xmlHttp==null){ alert ("This browser does not support AJAX!"); return; } /* * Variable setup for php or asp or jsp * Prepare your page to return * username ok or password ok */ var url="username_password.php"; url=url+"?username="+str1+"&password="+str2+"&q3="+str3+"&q4="+str4; // Must be used , dont change url=url+"&sid="+Math.random(); /* * Call output event * Query output represent * *condition can be removed */ xmlHttp.onreadystatechange=ajax_output1; // Execute GET method xmlHttp.open("GET",url,true); // Send Get or Post method xmlHttp.send(null); } /** * @ajax_output1 * Login failure * */ function ajax_output1(){ if (xmlHttp.readyState==4){ // Put the html <div id="s1"> $tim = time(); document.getElementById("s1").innerHTML=$tim; } } /** * @ajax_listen time bomb * Timer to ping and pong */ var tImer; function ajax_listen(){ ajax_main(1,2,3,4); cOunter=cOunter+1; tImer=setTimeout("ajax_listen()",1000); }
  14. remove this in first file and dow following. Should be ok, then you dont need time_test.php file. url = "time_test.php"; replace to $tim=time(); url = $tim;
  15. Hope this help your query? You have to add this file as your header javascript. and call the main function from your html > onmouseover or onClick event. /** * @xmlHttp used to detect the browser object * related pages * -------------------------------------------- * Basic standard useing */ var xmlHttp; /** * @GetXmlHttpObject used to detect the browser and set * xmlHttp * Firefox, Opera , Safari, IE * */ function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } /** * @ajax_main used inside the html action events * Function to be called from the main pages. * ajax_main(option1, option2, option3, option4) * example: * ajax_main( price.options[price.selectedIndex].value + ' ' + this.options[this.selectedIndex].value ); * */ function ajax_main(str1, str2, str3, str4){ // Set xmlHttp object for browser xmlHttp=GetXmlHttpObject(); // Condition for browser if (xmlHttp==null){ alert ("This browser does not support AJAX!"); return; } /* * Variable setup for php or asp or jsp * Prepare your page to return * username ok or password ok */ var url="username_password.php"; url=url+"?username="+str1+"&password="+str2+"&q3="+str3+"&q4="+str4; // Must be used , dont change url=url+"&sid="+Math.random(); /* * Call output event * Query output represent * *condition can be removed */ if(str1=="2"){ xmlHttp.onreadystatechange=ajax_output1; }else{ xmlHttp.onreadystatechange=ajax_output2; } // Execute GET method xmlHttp.open("GET",url,true); // Send Get or Post method xmlHttp.send(null); } /** * @ajax_output1 * Login failure * */ function ajax_output1(){ if (xmlHttp.readyState==4){ /* * Following line is used to get query result output * & Presentation to your page back with * Alert box or etc.......... */ if(xmlHttp.responseText.match("username ok")!=null) { // Usename returned from SQL str1 = "update table set session='online' where username='" + usenames + "' and password='password'"; ajax_call_sql(str1); // Show the page usename is found document.getElementById("s1").innerHTML="Username valid"; } } } /** * @ajax_output2 * reserved event... * */ function ajax_output2(vAcmd,vBcmd){ // for something else use // On Fly , SQL insert, update, delete }
  16. Use this for image handle for me working. /** * @GetXmlHttpObject used to detect the browser and set * xmlHttp * */ function GetXmlHttpObject(){ var xmlHttp=null; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); }catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); }catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } /** * @ajax_php_get used to detect the browser and fix required images * Function to be called from the main pages. * ajax_php_get(this.options[this.selectedIndex].value); * price.options[price.selectedIndex].value + ' ' + this.options[this.selectedIndex].value * */ function ajax_php_get(str1, str2, str3, str4){ // Set xmlHttp object for browser xmlHttp=GetXmlHttpObject(); // Condition for browser if (xmlHttp==null){ alert ("This browser does not support AJAX!"); return; } // Variable setup for php or asp var url="callback.php"; url=url+"?q1="+str1+"&q2="+str2+"&q3="+str3+"&q4="+str4; // Must be used , dont change url=url+"&sid="+Math.random(); // Call output function if(str1=="2"){ xmlHttp.onreadystatechange=ajax_php_output1; }else{ xmlHttp.onreadystatechange=ajax_php_output0; } // Execute GET method xmlHttp.open("GET",url,true); // Send Get or Post method xmlHttp.send(null); } /** * @A B leg * Dataarrival event * */ function ajax_ab_leg1(vAcmd,vBcmd){ var Aleg = document.getElementById("a1"); var Bleg = document.getElementById("b1"); if (vAcmd == "on"){ Aleg.src = "img/try.gif"; }else if(vAcmd == "ring"){ Aleg.src = "img/talk.gif"; }else if(vAcmd == "trying"){ Aleg.src = "img/busy.gif"; }else{ Aleg.src = "img/none.gif"; } if (vBcmd=="on"){ Bleg.src = "img/try.gif"; }else{ Bleg.src = "img/none.gif"; } }
  17. No basically, you can do that, somewhere you have to fix it, i made a real time mobile voip application. which contain FF, IE, Opera, worked fine, but you need to deep debug. *document.getElementById , and check your <div id="names" > reg shamun
  18. Many job place asking Drupal, but what is it actualy in simple word? 1. is it php ? or asp or jsp? 2. is it mysql ? or postgre or oracle ? 3. is it javascript or vbscript ? 4. is it apache or iis ? 5. is it linux or windows or unix ? or is it all together namely drupal? or drupal is completely a new language ? Many thanks
  19. Thanks working, i just manualy fix the path of font directory. And php parameters from code. <?php /* * This is an example of my first PDF test * Worked by NuSphere PHPed * Manualy downloaded library from * http://pecl4win.php.net/ext.php/php_pdf.dll */ /* * Stage - 1 * Resource create for PDF library */ $pdf = PDF_new(); /* * Stage - 2 * Save where? Path to create the file. */ pdf_open_file($pdf, "c:\heloworld.pdf"); /* * Stage - 3 * Page diemention (A4) */ pdf_begin_page($pdf, 595, 842); /* * Stage - 4 * path of your TTF font directory * can also use pdf_load_font(); * http://uk3.php.net/manual/en/function.pdf-findfont.php */ $fontdir = "C:\WINDOWS\Fonts"; pdf_set_parameter($pdf, "FontOutline", "arialMyName=$fontdir\arial.ttf"); $arial = PDF_findfont($pdf,"arialMyName","host",0 ); /* * Stage - 5 * Set font size and font name */ pdf_setfont($pdf, $arial, 10); /* * Stage - 6 * print text */ pdf_show_xy($pdf, "Hellow World? ",50, 750); pdf_show_xy($pdf, "Test 1, 2, 3, 4 working. ", 50,730); /* * Stage - 7 * end page */ pdf_end_page($pdf); /* * Stage - 8 * close and save file */ pdf_close($pdf); ?> Output as pdf: ################################### # # Hellow World? # Test 1, 2, 3, 4 working. # ###################################
  20. Changed the fonts to same error. Fatal error: Uncaught exception 'PDFlibException' with message 'Metrics data for font 'Verdana' not found' in D:\noname1.php:9 Stack trace: #0 D:\noname1.php(9): pdf_findfont(Resource id #1, 'Verdana', 'host', 1) #1 {main} thrown in D:\noname1.php on line 9
  21. #recompile code Fatal error: Fatal error: Uncaught exception 'PDFlibException' with message 'Metrics data for font 'Arial' not found' in D:\noname1.php:11 Stack trace: #0 D:\noname1.php(11): pdf_findfont(Resource id #1, 'Arial', 'host', 1) #1 {main} thrown in D:\noname1.php on line 11 #First was a php_pdf.dll file missing, i download it. - http://pecl4win.php.net/ext.php/php_pdf.dll #phpinfo() showing: PHP Version 5.2.6 PDF Support enabled PDFlib GmbH Version 5.0.3 PECL Version 2.1.4 Revision $Revision: 1.155 $
  22. I have this script, and php.ini, but i cant create pdf test yet, getting Fetal error. i am using NuSphere PHPed. Any suggestion? <?php // create handle for new PDF document $pdf = PDF_new(); // open a file pdf_open_file($pdf, "philosophy.pdf"); // start a new page (A4) pdf_begin_page($pdf, 595, 842); // get and use a font object $arial = pdf_findfont($pdf, "Arial", "host", 1); pdf_setfont($pdf, $arial, 10); // print text pdf_show_xy($pdf, "There are more things in heaven and earth, Horatio,",50, 750); pdf_show_xy($pdf, "than are dreamt of in your philosophy", 50,730); // end page pdf_end_page($pdf); // close and save file pdf_close($pdf); ?> php.ini : ;extension=php_bz2.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_exif.dll ;extension=php_fdf.dll ;extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_gmp.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_mbstring.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_msql.dll ;extension=php_mssql.dll extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll extension=php_pdo.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_oci8.dll ;extension=php_pdo_odbc.dll extension=php_pdo_pgsql.dll extension=php_pdo_sqlite.dll extension=php_pgsql.dll ;extension=php_pspell.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_soap.dll ;extension=php_sockets.dll extension=php_sqlite.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xmlrpc.dll ;extension=php_xsl.dll ;extension=php_zip.dll
  23. Thanks, it deep helped to understand PHP class tree.
  24. its ok now, strcmp() was needed to use, instead of using if ( ). <?php /* * This is a test of Class and there uses * Thanks for the NuSphere PHPed * */ // A Town of Usa class town{ // A building, with 3rd floor function f_building1($id){ switch($id){ case 1: echo "Karnel Smith, eating <br>"; return 0; break; case 2: echo "Peter Smith, showering <br>"; return 0; break; case 3: echo "John Smith, hacking.. <br>"; return "John Smith"; break; } } // A building, with 2 floor function f_building2($id){ switch($id){ case 1: echo "Bush Smith, reading reports <br>"; return 0; break; case 2: echo "Jack Smith, no job.. smoking.. <br>"; return 0; break; } } } // Police inquery, from car $pol = new town(); // Searching all building, Find John Smith!! programmer... $searching = "John Smith"; for ($i=0; $i<4; $i++ ){ $moving1 = $pol->f_building1($i); $moving2 = $pol->f_building2($i); if ( strcmp($moving1,$searching)==0) { echo "Sir, we found him, arrest him. <br>"; }else if( strcmp($moving2,$searching)==0 ){ echo "Sir, we found him, arrest him. <br>"; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.