473,803 Members | 4,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conversion to PHP5

2 New Member
8-7-2008

Hello,

Our hosting provider has changed his server to PHP5.
I have a PHP file that normaly gives the custumor an email, and i get one mail.
Now the server has changed i only get my email, but the custumor gets nothing.

Who can help me to change this PHP file to PHP5 ?????

Here is the file concept.

Expand|Select|Wrap|Line Numbers
  1.  <?php
  2.  
  3. // email adres waarnaar het formulier wordt gestuurd //////////////////////////////////////////
  4. // als deze waarde niet is ingevuld, wordt het send_to veld gebruikt
  5. $send_to = "Cartexpo.nl <info@cartexpo.nl>";
  6.  
  7. // variabele $send_cc voor een kopie naar een ander e-mailadres (niet de auto-reply)
  8. // bijvoorbeeld: $send_cc = array('vriend1@ccc.cc', 'vriend2@ccc.cc'); 
  9. //
  10. $send_cc = array(); 
  11.  
  12. // Onderwerp. Als dit leeg is wordt de waarde gebruikt die in het formulier is aangegeven
  13. $subject = "";
  14.  
  15. // Toegestane referrers (wie dit bestand mag gebruiken, meerdere waarden mogelijk)
  16. $referrers = array('cartexpo.nl'); 
  17.  
  18.  
  19. // Te verzamelen velden
  20. // $database_fields = '*' - betekent alle velden
  21. // $database_fields = array('from', 'subject') - alleen 'from' en 'subject' velden
  22. $database_fields = '*'; 
  23.  
  24. ////// Redirect URL (waar de bezoeker uitkomt na verzenden) 
  25. $redirect_url = 'bedankt.html';
  26.  
  27. ////// Automatisch antwoord
  28. ////// In het antwoord kun je variabelen op de volgende manier meegeven
  29. ////// %veld_naam% in de antwoord tekst.
  30. //////
  31.  
  32. $autoresponder_enabled = 0;
  33. $autoresponder_from = $send_to;
  34. $autoresponder_subject = "Bevestiging van informatie aanvraag cartexpo";
  35.  
  36. $headers  = "From: $send_to\r\n"; 
  37. $headers .= "Content-type: text/html\r\n"; 
  38.  
  39.  
  40.  
  41.  
  42.  
  43. ////// De velden uit het formulier omzetten in PHP variabelen
  44.  
  45.  
  46.  
  47. $voornaam = $_POST['voornaam'];
  48. $achternaam = $_POST['achternaam'];
  49. $geslacht = $_POST['geslacht'];
  50. $volledigenaam = "$voornaam $achternaam";
  51. $postcode = $_POST['postcode'];
  52.  
  53.  
  54. if ($extra_info <> "") {
  55.     $extra_info = "Uw vraag/opmerking:<BR>";
  56.     $extra_info .= $_POST['extra_info'];
  57.     } else {
  58.     $extra_info = "";
  59.     }
  60.  
  61.  
  62.  
  63. $autoresponder_message = <<
  64.  
  65.  
  66. <FONT font face="Arial, Helvetica, sans-serif">
  67.  
  68. Geachte $geslacht $achternaam,<BR>
  69.  
  70.  
  71. Bedankt voor uw informatie aanvraag betreffende het dealerschap van cartexpo<sup>®.
  72.  
  73. U heeft voor de volgende emaille producten informatie aangevraagd:<BR>
  74.  
  75.  
  76. $onderwerp<BR>
  77.  
  78.  
  79. $extra_info<BR>
  80.  
  81.  
  82. Om uw aanvraag effectief en snel te beantwoorden verzoeken wij U om de volgende informatie aan ons door te geven:<BR>
  83.  
  84.  
  85. <li> Locatie (b.v. winkelcentrum / A, B locatie / industrie terrein).
  86.  
  87. <li> Bedrijfsgrootte (aantal medewerkers).
  88.  
  89. <li> Welke naamplaten heeft u reeds in het assortiment (leveranciers + product)
  90.  
  91. <li> Al ervaring met emaille producten ja / nee.
  92.  
  93. <BR>
  94. U kunt deze informatie rechtstreeks mailen naar <a href="mailto:info@cartexpo.nl">info@cartexpo.nl
  95.  
  96. <BR>
  97. Voor vragen kunt u ons telefonisch bereiken onder tel. nr. 0297-524040<BR>
  98. (ma t/m. vr. van 9.00-18.00 uur.)<BR>
  99. <BR>
  100.  
  101. <BR>
  102.  
  103.  
  104. Met vriendelijke groet,<BR>
  105.  
  106.  
  107.  
  108.  
  109.  
  110. Het cartexpo.nk<sup>® Team
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117. cartexpo.nl<sup>®
  118.  
  119. Ondernemingsweg 1<BR>
  120. 1422 DZ Uithoorn<BR>
  121. Tel.: 0297-524040<BR>
  122. Fax: 0297-524042<BR>
  123.  
  124.  
  125.  
  126. </FONT>
  127.  
  128. MSG;
  129.  
  130.  
  131.  
  132. /***************************************************************************/
  133.  
  134. function do_formmail(){
  135.     global $autoresponder_enabled, $database_enabled;
  136.     $form      = get_form_data();
  137.     $errors    = check_form($form);
  138.     if ($errors) {
  139.         display_errors($errors);
  140.         return;
  141.     }
  142.     send_mail($form);
  143.     if ($autoresponder_enabled) 
  144.         auto_respond($form);
  145.     if ($database_enabled)
  146.         save_form($form);
  147.     redirect();
  148. }
  149.  
  150. function redirect(){
  151.     global $redirect_url;
  152.     header("Location: $redirect_url");
  153.     exit();
  154. }
  155.  
  156.  
  157. function save_form($vars){
  158.     global $database_file, $database_fields;
  159.     $f = fopen($database_file, 'a');
  160.     if (!$f){
  161.         die("Cannot open db file for save");
  162.     }
  163.     foreach ($vars as $k=>$v) {
  164.         $vars[$k] = str_replace(array("|", "\r","\n"), array('_',' ',' '), $v);
  165.     }
  166.     if (is_array($database_fields)) {
  167.         $vars_orig = $vars; 
  168.         $vars = array();
  169.         foreach ($database_fields as $k)
  170.             $vars[$k] = $vars_orig[$k];
  171.     }
  172.     $str = join('|', $vars);
  173.     fwrite($f, $str."\n");
  174.     fclose($f);
  175. }
  176.  
  177. function auto_respond($vars){
  178.     global $autoresponder_from, $autoresponder_message, $autoresponder_subject, $headers;
  179.  
  180.     /// replace all vars in message
  181.     $msg = $autoresponder_message;
  182.     preg_match_all('/%(.+?)%/', $msg, $out);
  183.     $s_vars = $out[1]; //field list to substitute
  184.     foreach ($s_vars as $k)
  185.         $msg = str_replace("%$k%", $vars[$k], $msg);
  186.     /// replace all vars in subject
  187.     $subj = $autoresponder_subject;
  188.     preg_match_all('/%(.+?)%/', $subj, $out);
  189.     $s_vars = $out[1]; //field list to substitute
  190.     foreach ($s_vars as $k)
  191.         $subj = str_replace("%$k%", $vars[$k], $subj);
  192.     //
  193.     $space = " ";
  194.     $name = $vars[voornaam]  . $space .  $vars[achternaam];
  195.     $_send_to = "$name <".$vars[email_from].">";
  196.     $_send_from = $autoresponder_from;
  197.     mail($_send_to, $subj, $msg, "$headers");
  198. }
  199.  
  200. function _build_fields($vars){
  201.     $skip_fields = array(
  202.         'name_from', 
  203.         'email_from', 
  204.         'email_to', 
  205.         'name_to', 
  206.         'subject');
  207.     // order by numeric begin, if it exists
  208.     $is_ordered = 0;
  209.     foreach ($vars as $k=>$v) 
  210.         if (in_array($k, $skip_fields)) unset($vars[$k]);
  211.  
  212.     $new_vars = array();
  213.     foreach ($vars as $k=>$v){
  214.         // remove _num, _reqnum, _req from end of field names
  215.         $k = preg_replace('/_(req|num|reqnum)$/', '', $k);
  216.         // check if the fields is ordered
  217.         if (preg_match('/^\d+[ \:_-]/', $k)) $is_ordered++;
  218.         //remove number from begin of fields
  219.         $k = preg_replace('/^\d+[ \:_-]/', '', $k);
  220.         $new_vars[$k] = $v;
  221.     }
  222.     $vars = $new_vars;
  223.  
  224.     $max_length = 10; // max length of key field 
  225.     foreach ($vars as $k=>$v) {
  226.         $klen = strlen($k);
  227.         if (($klen > $max_length) && ($klen < 40))
  228.             $max_length = $klen;
  229.     }
  230.  
  231.     if ($is_ordered)
  232.         ksort($vars);
  233.  
  234.     // make output text
  235.     $out = "";
  236.     foreach ($vars as $k=>$v){
  237.         $k = str_replace('_', ' ', $k);
  238.         $k = ucfirst($k);
  239.         $len_diff = $max_length - strlen($k);
  240.         if ($len_diff > 0) 
  241.             $fill = str_repeat('.', $len_diff);
  242.         else 
  243.             $fill = '';
  244.         $out .= $k."$fill...: $v\n";
  245.     }
  246.     return $out;
  247. }
  248.  
  249.  
  250. function send_mail($vars){
  251.     global $send_to, $send_cc;
  252.     global $subject;
  253.     global $attachment_enabled;
  254.     global $REMOTE_ADDR;
  255.     global $klanttekst;
  256.     global $tabelstop;
  257.     global $totalekosten;
  258.     global $transporttekst;
  259.     global $send_to;
  260.     global $autoresponder_from;
  261.     global $onderwerp;
  262.  
  263.  
  264.     global $HTTP_POST_FILES;
  265.     $files = array(); //files (field names) to attach in mail
  266.     if (count($HTTP_POST_FILES) && $attachment_enabled){
  267.         $files = array_keys($HTTP_POST_FILES);
  268.     }
  269.  
  270.     // build mail
  271.     $date_time = date('Y-m-d H:i:s');
  272.     $mime_delimiter = md5(time());
  273.     $fields = _build_fields($vars);
  274.  
  275.  
  276.     $bedrijfsnaam = $_POST['bedrijfsnaam'];
  277.     $geslacht = $_POST['geslacht'];
  278.     $voornaam = $_POST['voornaam'];
  279.     $achternaam = $_POST['achternaam'];
  280.     $adres = $_POST['adres'];
  281.     $postcode = $_POST['postcode'];
  282.     $plaats = $_POST['plaats'];
  283.     $land = $_POST['land'];
  284.     $telefoon = $_POST['telefoon'];
  285.     $fax = $_POST['fax'];
  286.     $emailklant = $_POST['email_from'];
  287.     $website = $_POST['website'];
  288.     $extra_info = $_POST['extra_info'];
  289.  
  290.  
  291.  
  292.     global $autoresponder_message;
  293.  
  294.     $mail = <<
  295. This is a MIME-encapsulated message
  296. --$mime_delimiter
  297. Content-type: text/html
  298. Content-Transfer-Encoding: 8bit
  299.  
  300. <STYLE TYPE='text/css'> BODY { font-size: 12px } TD { font-size: 12px } P { font-size: 12pt }  { font-size: 90% }
  301.  
  302. <CENTER>Cartexpo.nl - informatie formulier
  303.  
  304.  
  305.  
  306.  
  307. <FONT font face="Arial, Helvetica, sans-serif">
  308.  
  309.  
  310. $geslacht $achternaam wil meer informatie over:<BR>
  311.  
  312.  
  313. $extra_info<BR>
  314.  
  315.  
  316.  
  317.  
  318. </FONT>
  319.  
  320.  
  321.  
  322.  
  323. <B>Gegevens $geslacht $achternaam
  324.  
  325.  
  326.  
  327. Bedrijfsnaam: $bedrijfsnaam<BR>
  328. Voornaam: $voornaam<BR>
  329. Achternaam: $achternaam<BR>
  330.  
  331.  
  332. Adres: $adres<BR>
  333. Postcode: $postcode<BR>
  334. Plaats: $plaats<BR>
  335. Land: $land<BR>
  336. Telefoon: $telefoon<BR>
  337. Fax: $fax<BR>
  338. E-mail: <a href="mailto:$emailklant">$emailklant
  339.  
  340. Website: <a href="$website">$website
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348. EOF;
  349.  
  350.  
  351.  
  352.     //send to
  353.     $_send_to = $send_to ? $send_to : "$vars[name_to] <".$vars[email_to].">";
  354.     $space = " ";
  355.     $name = $vars[voornaam]  . $space .  $vars[achternaam];
  356.     $_send_from = "$name <".$vars[email_from].">";
  357.     $_subject = $subject ? $subject : $vars['subject'];
  358.  
  359.     mail($_send_to, $_subject, $mail, 
  360.     "Mime-Version: 1.0\r\nFrom: $_send_from\r\nContent-Type: multipart/mixed;\n boundary=\"$mime_delimiter\"\r\nContent-Disposition: inline");
  361.  
  362.     foreach ($send_cc as $v){
  363.       mail($v, $_subject, $mail, 
  364.       "Mime-Version: 1.0\r\nFrom: $_send_from\r\nContent-Type: multipart/mixed;\n boundary=\"$mime_delimiter\"\r\nContent-Disposition: inline");
  365.     }
  366.  
  367. }
  368.  
  369. function get_form_data(){
  370.     global $REQUEST_METHOD;
  371.     global $HTTP_POST_VARS;
  372.     global $HTTP_GET_VARS;
  373.  
  374.     $vars = ($REQUEST_METHOD == 'GET') ? $HTTP_GET_VARS : $HTTP_POST_VARS;
  375.     //strip spaces from all fields
  376.     foreach ($vars as $k=>$v) $vars[$k] = trim($v);
  377.     return $vars;
  378. }
  379.  
  380. function check_form($vars){
  381.     global $referrers;
  382.     global $send_to;
  383.     global $subject;
  384.     global $HTTP_REFERER;
  385.  
  386.     $bedrijfsnaam = $_POST['bedrijfsnaam'];
  387.     $geslacht = $_POST['geslacht'];
  388.     $voornaam = $_POST['voornaam'];
  389.     $achternaam = $_POST['achternaam'];
  390.     $adres = $_POST['adres'];
  391.     $postcode = $_POST['postcode'];
  392.     $plaats = $_POST['plaats'];
  393.     $land = $_POST['land'];
  394.     $telefoon = $_POST['telefoon'];
  395.     $fax = $_POST['fax'];
  396.     $emailklant = $_POST['email_from'];
  397.     $website = $_POST['website'];
  398.  
  399.  
  400.     $errors = array();
  401.  
  402.  
  403.  if (!$geslacht){
  404.             $errors[1] = "<b>Heer/Mevrouw is niet gekozen";
  405.         }
  406.  if (!$adres){
  407.             $errors[4] = "<b>Adres veld is leeg";
  408.         }
  409.  if (!$postcode){
  410.             $errors[5] = "<b>Postcode veld is leeg";
  411.         }
  412.  if (!$plaats){
  413.             $errors[6] = "<b>Plaats veld is leeg";
  414.         }
  415.  if (!$telefoon){
  416.             $errors[7] = "<b>Telefoon nummer veld is leeg";
  417.         }
  418.  if (!$bedrijfsnaam){
  419.             $errors[8] = "<b>Bedrijfsnaam veld is leeg";
  420.         } 
  421.  
  422.     // check from email set
  423.     if (!strlen($vars['email_from'])){
  424.         $errors[] = "<b>Email adres veld is fout/niet ingevuld";
  425.     } else if (!check_email($vars['email_from'])){
  426.         $errors[] = "<b>Email adres veld is leeg/incorrect";        
  427.     }                 
  428.     if (!strlen($send_to) && !strlen($vars['email_to'])){
  429.         $errors[] = "<b>Ontvangende email adres leeg (check configuratie)";
  430.     } else if (!strlen($send_to) && !check_email($vars['email_to'])){
  431.         //if to email specified in form, check it and display error
  432.         $errors[] = "<b>Ontvangende email adres incorrect";        
  433.     }
  434.     if (!strlen($vars['subject']) && !strlen($subject)){
  435.         $errors[] = "<b>Subject leeg (check configuratie)";
  436.     }
  437.     foreach ($vars as $k=>$v){
  438.         // check for required fields (end with _req)
  439.         if (preg_match('/^(.+?)_req$/i', $k, $m) && !strlen($v)){
  440.             $field_name = ucfirst($m[1]);
  441.             $errors[] = "Required field <b>$field_name leeg";
  442.         }
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.   if (preg_match('/^(.+?)_req$/i', $k, $m) && !strlen($v)){
  450.             $field_name = ucfirst($m[1]);
  451.             $errors[] = "Required field <b>$field_name leeg";
  452.         }
  453.  if (preg_match('/^(.+?)_req$/i', $k, $m) && !strlen($v)){
  454.             $field_name = ucfirst($m[1]);
  455.             $errors[] = "Required field <b>$field_name leeg";
  456.         }
  457.  if (preg_match('/^(.+?)_req$/i', $k, $m) && !strlen($v)){
  458.             $field_name = ucfirst($m[1]);
  459.             $errors[] = "Required field <b>$field_name leeg";
  460.         }
  461.         // check for number fields (end with _num)
  462.         if (preg_match('/^(.+?)_num$/i', $k, $m) && strlen($v) && !is_numeric($v)){
  463.             $field_name = ucfirst($m[1]);
  464.             $errors[] = "Field <b>$field_name must contain only digits or be leeg";
  465.         }
  466.         // check for number & required fields (end with _reqnum)
  467.         if (preg_match('/^(.+?)_reqnum$/i', $k, $m) && !is_numeric($v)){
  468.             $field_name = ucfirst($m[1]);
  469.             $errors[] = "Field <b>$field_name must contain digits and only digits";
  470.         }
  471.     }
  472.  
  473.  
  474.     return $errors;
  475. }
  476.  
  477. function display_errors($errors){
  478. $errors = '<li>' . join('<li>', $errors);
  479. print <<
  480. <html>
  481.     <head>
  482. <title>TopEmaille.nl
  483. <link rel="stylesheet" type="text/css" href="bestelformulier.css">
  484. </head>
  485.  
  486. <body bgcolor=white>
  487.     <h3 align=center>[color=red]Er is een fout opgetreden[/color]
  488.     <hr width=80%>
  489.     <table align=center>
  490.     $errors
  491.     </td>
  492.     <p align=center>
  493.     Vul de velden correct in s.v.p.<BR>
  494.  
  495. <a href="javascript: history.back(-1)">< Terug
  496.     </p>
  497.     <hr width=80%>
  498.     <center>
  499.     <font size=2>cartexpo.nl ©, 2005
  500.     </center>
  501. </body>
  502. EOF;
  503. }
  504.  
  505.  
  506. /**
  507. * Check email using regexes
  508. * @param string email
  509. * @return bool true if email valid, false if not
  510. */
  511. function check_email($email) {
  512.     #characters allowed on name: 0-9a-Z-._ on host: 0-9a-Z-. on between: @
  513.     if (!preg_match('/^[0-9a-zA-Z\.\-\_]+\@[0-9a-zA-Z\.\-]+$/', $email))
  514.         return false;
  515.  
  516.     #must start or end with alpha or num
  517.     if ( preg_match('/^[^0-9a-zA-Z]|[^0-9a-zA-Z]$/', $email))
  518.         return false;
  519.  
  520.     #name must end with alpha or num
  521.     if (!preg_match('/([0-9a-zA-Z_]{1})\@./',$email) )                    
  522.         return false;
  523.  
  524.     #host must start with alpha or num
  525.     if (!preg_match('/.\@([0-9a-zA-Z_]{1})/',$email) )                    
  526.         return false;
  527.  
  528.     #pair .- or -. or -- or .. not allowed
  529.     if ( preg_match('/.\.\-.|.\-\..|.\.\..|.\-\-./',$email) )
  530.         return false;
  531.  
  532.     #pair ._ or -_ or _. or _- or __ not allowed
  533.     if ( preg_match('/.\.\_.|.\-\_.|.\_\..|.\_\-.|.\_\_./',$email) )
  534.         return false;
  535.  
  536.     #host must end with '.' plus 2-5 alpha for TopLevelDomain
  537.     if (!preg_match('/\.([a-zA-Z]{2,5})$/',$email) )
  538.         return false;
  539.  
  540.     return true;
  541. }
  542.  
  543. do_formmail();
  544. ?>
  545.  
I hope some one can help me with this.

Greetzzzz

Leendert
Jul 8 '08 #1
5 1977
Markus
6,050 Recognized Expert Expert
There's no way I, nor others, will be able to read that.

Please use code tags when posting code in the forums.
Jul 8 '08 #2
The Big One
2 New Member
There's no way I, nor others, will be able to read that.

Please use code tags when posting code in the forums.
Is it possible that i send you the file??

Leendert
Jul 8 '08 #3
Markus
6,050 Recognized Expert Expert
550 lines of code!

Unfortunately it is time for me to leave for holiday!

In the nick-of-time, too.

Hopefully someone else will be able to help with that hefty code.

Kind regards.
Jul 8 '08 #4
Atli
5,058 Recognized Expert Expert
Hi.

Try the tips in this thread and see if you get any error messages.

A quick look at your code tells me you will probably get a few warnings and notices.

Try to solve them and post back if you run into any problems.
Jul 15 '08 #5
coolsti
310 Contributor
I would say just try it.

I migrated an entire database application that I developed over the past years for my company from PHP 4.x to PHP 4.x recently, and I didn't have to change any lines of code at all.

I did get a large amount of warnings about depreciated syntax and other syntax that did not meet with the PHP5 standards, but the code works as it did before.
Jul 16 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
3700
by: Christoph Nothdurfter | last post by:
Hallo! I was wondering if my PHP4-Scripts will run under PHP5 (Haeven't tried the beta yet). Does anybody know? Thank you, -Christoph
8
2993
by: Rob Ristroph | last post by:
I have tried out PHP 5 for the first time (with assistance from this group -- thanks!). The people I was working with have a site that uses lots of php objects. They are having problems with speed. They had a vague idea that PHP5 has improved handling of objects over PHP4, so it would probably be faster also. In fact it seems slower. We did a few timing loops, in which a a number of objects were created and and members were...
11
10586
by: neur0maniak | last post by:
Hi, I've been eager to try out PHP5, so I've dumped it on my little dev machine. It's running WinXP with IIS5. I've put the php-cgi.exe in the "mappings" page as I'm used to doing with PHP4. I've got my php.ini all set in C:\Windows. I created an index.php containing: <?php phpinfo(); ?> When I try to view the page, I get "HTTP 400 - Bad Request".
4
5838
by: badbetty | last post by:
Dear Googlers I have installed PHP5 to run on WinXP against Apache 2. It works! ie. I have tested a few simple scripts and a basic xml document parse. I now want to try the XSL extension so I can transform xml docs. Having copied the php_xsl.dll to a directory where it can be found and done the uncommenting in php.ini, it still will not work. The script I
5
2165
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me a little: "As php5 and mysql5 are still beta versions we don't install beta versions on production servers due to secure reasons, we install only current working versions on production servers"
4
2761
by: Chuck Anderson | last post by:
I am trying to install Php5 on my WindowsXP machine (at home, not on the 'net). I downloaded the Php Windows binary at php.net, unzipped it to c:/Php5, changed my Apache config file to use Php5 with: LoadModule php5_module "c:/Php5/php5apache2.dll" .... and restarted apache (Apache/2.0.55 (Win32) mod_ssl/2.0.55 OpenSSL/0.9.8a) Php5 works fine, but when I execute phpinfo, the registered streams are:
19
2371
by: McKirahan | last post by:
I am working in two environments neither configuration of which I can change; one's my Web host the other a client. My Web host requires the use of the ".php5" extension to use PHP v5.1.4; where ".php" is used for PHP v4.3.11. My client supports PHP v5.2.0 with the ".php" extension. Is there a way to reliably determine if the ".php5" extension must be used on a server? Perhaps via a "phpinfo()" value?
3
3305
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5, only that in old version, I can use $row to access the data in database directly, no need to put double quote around fieldname. BUT in PHP5, this is wrong, I got error message "undefined constant". I know this is because PHP5 see the fieldname...
8
2321
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the constructors work seem to have changed quite a bit and I am not getting the same behavior across the versions. // Some simple code/
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.