Jump to content

help optimizing script


dflow

Recommended Posts

im having this problem with this script

it is supposed to show a previrew of an html age and save  it to a folder

 

i get a server error on the server

this is the response i got from the hosting support

"Ok, this error shows that your script fails to execute successfully. It seems that the script is trying to execute more than the allowed simultaneous processes so our system halts the process and displays this error.

 

This is not an error that you can fix by altering the PHP settings. This can be resolved by optimizing your script.

 

This is a security restriction on the server that cannot be turned off. The server halts your process as it is a threat to the server's stability."

 

here is the code how can i downsize the number of processes?

<?php require_once('../Connections/international.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? 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;
}
}
?>
<? mysql_query("SET NAMES 'utf8'"); ?>
<?php
$colname_RsCommit_form = "-1";
if (isset($_GET['PropID'])) {
  $colname_RsCommit_form = $_GET['PropID'];
}
mysql_select_db($database_international, $international);
$query_RsCommit_form = sprintf("SELECT * FROM proposals WHERE RequestID = %s", GetSQLValueString($colname_RsCommit_form, "int"));
$RsCommit_form = mysql_query($query_RsCommit_form, $international) or die(mysql_error());
$row_RsCommit_form = mysql_fetch_assoc($RsCommit_form);
$totalRows_RsCommit_form = mysql_num_rows($RsCommit_form);
?>
<html lang="he" dir="rtl">
<head>
<title>COMMITMENT_FORM_<?php echo $row_RsCommit_form['CustomerLastName']; ?>_<?php echo $row_RsCommit_form['CustomerFirstName']; ?>_<?php echo $row_RsCommit_form['CityName']; ?></title>
<meta http-equiv="Content-Language" content="he"dir="rtl">
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8" />

</head>

<body>
<table width="750" border="0" align="center">
  <tr> 
    <td colspan="5"><div align="right"><img src="http://company.com/images/companylogo_heb.gif" width="284" height="92"></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"><font size="2"><img src="http://company.com/images/company_Address_heb.gif" width="548" height="40"></font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"> <font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
        &#1492;&#1494;&#1502;&#1504;&#1492; : 1458<?php echo $row_RsCommit_form['RequestID']; ?>x4rvs </font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"> <font size="2" face="Arial, Helvetica, sans-serif">&#1496;&#1493;&#1508;&#1505; 
        &#1492;&#1514;&#1495;&#1497;&#1497;&#1489;&#1493;&#1514; &#1500;&#1502;&#1497;&#1502;&#1493;&#1513; 
        &#1495;&#1489;&#1497;&#1500;&#1492;</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"> </td>
  </tr>
  <tr> 
    <td><div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"></div>
      <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
        &#1504;&#1510;&#1497;&#1490; &#1492;&#1502;&#1494;&#1502;&#1497;&#1504;&#1497;&#1501;</font></div></td>
    <td> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
        &#1508;&#1512;&#1496;&#1497; </font></div></td>
    <td> <div align="right"> <font size="2" face="Arial, Helvetica, sans-serif"><?php echo $row_RsCommit_form['CustomerFirstName']; ?> </font></div></td>
    <td> <div align="right"> <font size="2" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
        &#1502;&#1513;&#1508;&#1495;&#1492; </font></div></td>
    <td> <div align="right"> <font size="2" face="Arial, Helvetica, sans-serif"><?php echo $row_RsCommit_form['CustomerLastName']; ?> </font></div></td>
  </tr>
  <tr> 
    <td><font size="2" face="Arial, Helvetica, sans-serif"> </font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif"> </font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif">&#1499;&#1514;&#1493;&#1489;&#1514;</font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif"> </font></td>
    <td><font size="2" face="Arial, Helvetica, sans-serif"> </font></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"> 
        <table width="750" border="0">
          <tr> 
            <td width="243"><div align="left"><font size="2" face="Arial, Helvetica, sans-serif">&#1512;&#1495;&#1493;&#1489;______________</font></div></td>
            <td width="37"><div align="right"></div></td>
            <td width="112"><div align="left"><font size="2" face="Arial, Helvetica, sans-serif">&#1506;&#1497;&#1512;______________</font></div></td>
            <td width="29"> </td>
            <td width="112"><div align="left"><font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1497;&#1511;&#1493;&#1491;______________</font></div></td>
            <td width="142"><div align="right"></div></td>
            <td width="40"><div align="left"></div></td>
          </tr>
          <tr> 
            <td colspan="3"><div align="right"></div></td>
            <td> </td>
            <td><div align="right"></div></td>
            <td><div align="right"></div></td>
            <td><div align="right"></div></td>
          </tr>
        </table>
      </div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"><font face="Arial, Helvetica, sans-serif"><font size="2"></font></font></div></td>
  </tr>
  <tr valign="top"> 
    <td colspan="5"> </td>
  </tr>
  <tr> 
    <td colspan="5"><font color="#000033" size="2" face="Geneva, Arial, Helvetica, sans-serif"><font color="#0000FF" size="2"><?php echo $row_RsCommit_form['CountryName']; ?> _
          <?php /*START_PHP_SIRFCIT*/ if ($row_RsCommit_form['RegionName']<>"_"){ ?>
          <?php echo $row_RsCommit_form['RegionName']; ?> _
          <?php } /*END_PHP_SIRFCIT*/ ?>
          <?php /*START_PHP_SIRFCIT*/ if ($row_RsCommit_form['CityName']<>"_"){ ?>
          <?php echo $row_RsCommit_form['CityName']; ?>
          <?php } /*END_PHP_SIRFCIT*/ ?>
_ <?php echo $row_RsCommit_form['CustomerLastName']; ?> _party_ <?php echo $row_RsCommit_form['DepartureDate']; ?> - <?php echo $row_RsCommit_form['ReturnDate']; ?> - <?php echo $row_RsCommit_form['TotalNumber']; ?> PAX</font></font><font size="2" face="Arial, Helvetica, sans-serif">- <font color="#0000FF">AGENT -<?php echo $row_RsCommit_form['AgentName']; ?></font></font></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1514;&#1488;&#1512;&#1497;&#1499;&#1497; 
        &#1492;&#1504;&#1505;&#1497;&#1506;&#1492;: </font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"> <font size="2" face="Arial, Helvetica, sans-serif"> 
        &#1505;&#1492;"&#1499; <?php echo $row_RsCommit_form['num_nights']; ?> &#1500;&#1497;&#1500;&#1493;&#1514; <?php echo $row_RsCommit_form['ReturnDate']; ?> - <?php echo $row_RsCommit_form['DepartureDate']; ?> </font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1495;&#1497;&#1512; &#1500;&#1500;&#1497;&#1500;&#1492; &#1499;&#1488;&#1502;&#1493;&#1512; <?php echo $row_RsCommit_form['company_price_per_night']; ?> <?php echo $row_RsCommit_form['Currency']; ?> +&#1504;&#1497;&#1511;&#1497;&#1493;&#1503; &#1505;&#1493;&#1508;&#1497; &#1500;&#1491;&#1497;&#1512;&#1492;: <?php echo $row_RsCommit_form['finalcleaning']; ?> <?php echo $row_RsCommit_form['Currency']; ?> 
        <?php /*START_PHP_SIRFCIT*/ if ($row_RsCommit_form['Changes_Charge']!=""){ ?>
        + &#1491;&#1502;&#1497; &#1513;&#1497;&#1504;&#1493;&#1497; <?php echo $row_RsCommit_form['Changes_Charge']; ?><?php echo $row_RsCommit_form['Currency']; ?>
        <?php } /*END_PHP_SIRFCIT*/ ?>
        =<?php echo $row_RsCommit_form['FINALPRICE']; ?> <?php echo $row_RsCommit_form['Currency']; ?> &#1500;&#1499;&#1500; &#1492;&#1514;&#1511;&#1493;&#1508;&#1492;</font></div></td>
  </tr>
  <tr align="right" valign="top"> 
    <?php /*START_PHP_SIRFCIT*/ if ($row_RsCommit_form['company_Flight_Price']!=""){ ?>
    <td colspan="5"><font size="2" face="Arial, Helvetica, sans-serif">&#1508;&#1497;&#1512;&#1493;&#1496; 
      &#1496;&#1497;&#1505;&#1493;&#1514;: &#1502;&#1495;&#1497;&#1512; &#1499;&#1512;&#1496;&#1497;&#1505; &#1500;&#1488;&#1491;&#1501; &#1499;&#1493;&#1500;&#1500; &#1502;&#1497;&#1505;&#1497;&#1501; <?php echo $row_RsCommit_form['TotalNumber']; ?> * <?php echo $row_RsCommit_form['company_Flight_Price']; ?>$ &#1505;&#1492;"&#1499; <?php echo $row_RsCommit_form['Total_Flights_Dollar']; ?>$ = <?php echo $row_RsCommit_form['TotalFlightsPrice']; ?> &#8364;</font></td>
    <?php } /*END_PHP_SIRFCIT*/ ?>
  </tr>
  <tr align="right" valign="top"> 
    <td colspan="5"><font size="2" face="Arial, Helvetica, sans-serif"> 
      <?php /*START_PHP_SIRFCIT*/ if ($row_RsCommit_form['CarRentalPrice']!=""){ ?>
      &#1492;&#1513;&#1499;&#1512;&#1514; &#1512;&#1499;&#1489;: &#1502;&#1495;&#1497;&#1512; &#1500;&#1512;&#1499;&#1489; &#1500;&#1497;&#1493;&#1501; <?php echo $row_RsCommit_form['CarRentalPrice']; ?> * <?php echo $row_RsCommit_form['rent_car_num_days']; ?> &#1505;&#1492;"&#1499; <?php echo $row_RsCommit_form['TotalCarRentalPrice']; ?> 
      <?php } /*END_PHP_SIRFCIT*/ ?>
      </font></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1497;&#1511;&#1491;&#1502;&#1492; 
        &#1500;&#1514;&#1513;&#1500;&#1493;&#1501; &#1499;&#1488;&#1503; =<?php echo $row_RsCommit_form['PREPAYMENT_company']; ?> <?php echo $row_RsCommit_form['Currency']; ?>    =  &#8362;<?php echo $row_RsCommit_form['PREPAYMENT_company_SHEKEL']; ?> &#1489;&#1510;'&#1511; &#1488;&#1493; &#1492;&#1506;&#1489;&#1512;&#1492; 
        &#1500;&#1495;&#1513;&#1489;&#1493;&#1503; &#1513;&#1511;&#1500;&#1497;&#1501;</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"> 
        </font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">????? ???? ???? ?????: <?php echo $row_RsCommit_form['PAYTOSUPPLIER']; ?> <?php echo $row_RsCommit_form['Currency']; ?> </font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"> ?-<?php echo $row_RsCommit_form['Currency']; ?> &#1502;&#1495;&#1493;&#1513;&#1489; &#1489;&#1514;&#1495;&#1493;&#1501; 
        &#1492;&#1504;&#1505;&#1497;&#1506;&#1493;&#1514; &#1500;&#1508;&#1497; 
        &#1513;&#1506;&#1512; &#1489;&#1504;&#1511;&#1504;&#1493;&#1496;&#1497;&#1501;-&#1513;&#1496;&#1512;&#1493;&#1514; 
        (&#1502;&#1499;&#1497;&#1512;&#1492;) . &#1492;&#1513;&#1506;&#1512; &#1492;&#1497;&#1493;&#1501; 
        &#1492;&#1493;&#1488; <?php echo $row_RsCommit_form['EUROSHEKEL']; ?> &#1513;&#1511;&#1500; <?php echo $row_RsCommit_form['Currency']; ?> .</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"> 
        <table width="599" border="0">
          <tr> 
            <td> </td>
            <td> </td>
            <td><font size="2" face="Arial, Helvetica, sans-serif">&#1499;&#1512;&#1496;&#1497;&#1505; 
              &#1488;&#1513;&#1512;&#1488;&#1497; &#1500;&#1489;&#1496;&#1493;&#1495;&#1492;</font></td>
            <td> </td>
          </tr>
          <tr> 
            <td width="33"> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
                &#1492;&#1499;&#1512;&#1496;&#1497;&#1505;</font></div></td>
            <td width="211"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif">___________________________</font></div></td>
            <td width="270"> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1514;&#1493;&#1511;&#1507;____/____</font></div></td>
            <td width="67"> <div align="right"></div></td>
          </tr>
          <tr> 
            <td> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
                &#1489;&#1506;&#1500; &#1492;&#1499;&#1512;&#1496;&#1497;&#1505;</font></div></td>
            <td> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">_____________________</font></div></td>
            <td> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
                &#1494;&#1492;&#1493;&#1514;_________________</font></div></td>
            <td> <div align="right"></div></td>
          </tr>
          <tr> 
            <td> <div align="right"></div></td>
            <td> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif">&#1495;&#1514;&#1497;&#1502;&#1492;</font></div></td>
            <td> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif">_________________________X</font></div></td>
            <td> <div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><img src="http://company.com/images/company_STAMP_IMAGE.jpg"></font></div></td>
          </tr>
        </table>
      </div></td>
  </tr>
  <tr> 
    <td colspan="5"> <div align="right"><font face="Arial, Helvetica, sans-serif">&#1508;&#1512;&#1496;&#1497; 
        &#1514;&#1513;&#1500;&#1493;&#1501; &#1489;&#1510;'&#1511;</font></div></td>
  </tr>
  <tr align="right" valign="top"> 
    <td colspan="5"><table width="750" border="1">
        <tr> 
          <td><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1514;&#1488;&#1512;&#1497;&#1498; 
              &#1492;&#1510;'&#1511;</font></div></td>
          <td width="120"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
              &#1492;&#1510;'&#1511;<br>
              </font></div></td>
          <td width="120"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
              &#1495;&#1513;&#1489;&#1493;&#1503;<br>
              </font></div></td>
          <td width="60"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
              &#1505;&#1504;&#1497;&#1507;<br>
              </font></div></td>
          <td width="60"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1502;&#1505;&#1508;&#1512; 
              &#1489;&#1504;&#1511;<br>
              </font></div></td>
          <td width="100"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
              &#1489;&#1504;&#1511;<br>
              </font></div></td>
          <td width="150"><div align="center"><font size="1" face="Arial, Helvetica, sans-serif">&#1513;&#1501; 
              &#1489;&#1506;&#1500; &#1492;&#1495;&#1513;&#1489;&#1493;&#1503;<br>
              </font></div></td>
        </tr>
        <tr> 
          <td><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="120"><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="120"><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="60"><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="60"><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="100"><div align="right"><font face="Arial, Helvetica, sans-serif"><font size="1">.</font></font></div></td>
          <td width="150" valign="top"><div align="right">.</div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif">&#1488;&#1504;&#1497; 
        &#1502;&#1514;&#1495;&#1497;&#1497;&#1489;/&#1502;&#1514;&#1495;&#1497;&#1497;&#1489;&#1514; 
        &#1500;&#1512;&#1499;&#1493;&#1513; &#1488;&#1514; &#1492;&#1502;&#1490;&#1493;&#1512;&#1497;&#1501; 
        &#1492;&#1504;"&#1500; &#1506;&#1500; &#1489;&#1505;&#1497;&#1505; 
        &#1500;&#1497;&#1504;&#1492; &#1489;&#1500;&#1489;&#1491; &#1489;&#1502;&#1495;&#1497;&#1512; 
        &#1492;&#1504;"&#1500;. &#1502;&#1491;&#1497;&#1504;&#1497;&#1493;&#1514; 
        &#1489;&#1497;&#1496;&#1493;&#1500; &#1500;&#1492;&#1494;&#1502;&#1504;&#1492;: 
        &#1500;&#1490;&#1489;&#1497; &#1492;&#1502;&#1490;&#1493;&#1512;&#1497;&#1501;: 
        &#1489;&#1502;&#1497;&#1491;&#1492; &#1513;&#1500; &#1489;&#1497;&#1496;&#1493;&#1500; 
        &#1497;&#1495;&#1493;&#1500;&#1493; &#1491;&#1502;&#1497; &#1489;&#1497;&#1496;&#1493;&#1500; 
        &#1499;&#1491;&#1500;&#1492;&#1500;&#1503;: &#1502;&#1512;&#1490;&#1506; 
        &#1492;&#1492;&#1494;&#1502;&#1504;&#1492; &#1506;&#1491; &#1513;&#1489;&#1493;&#1506;&#1497;&#1497;&#1501; 
        &#1500;&#1508;&#1504;&#1497; &#1492;&#1492;&#1490;&#1506;&#1492; &#1497;&#1495;&#1493;&#1497;&#1489; 
        &#1489;- 50% &#1491;&#1502;&#1497; &#1489;&#1497;&#1496;&#1493;&#1500;. 
        &#1492;&#1495;&#1500; &#1493;&#1489;&#1502;&#1492;&#1500;&#1498; &#1513;&#1489;&#1493;&#1506;&#1497;&#1497;&#1501; 
        &#1513;&#1500;&#1508;&#1504;&#1497; &#1502;&#1493;&#1506;&#1491; &#1514;&#1495;&#1497;&#1500;&#1514; 
        &#1492;&#1492;&#1513;&#1499;&#1512;&#1492; 100% &#1502;&#1505;&#1499;&#1493;&#1501; 
        &#1492;&#1492;&#1513;&#1499;&#1512;&#1492;.</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"> 
        &#1514;&#1504;&#1488;&#1497; &#1514;&#1513;&#1500;&#1493;&#1501; &#1504;&#1488; 
        &#1500;&#1511;&#1512;&#1493;&#1488; &#1499;&#1488;&#1503; : http://company.com/heb/termsandconditions_heb.php 
        &#1511;&#1512;&#1488;&#1514;&#1497; &#1493;&#1488;&#1504;&#1497; &#1502;&#1505;&#1499;&#1497;&#1501; 
        &#1500;&#1514;&#1504;&#1488;&#1497;&#1501; &#1492;&#1512;&#1513;&#1493;&#1502;&#1497;&#1501; 
        &#1492;&#1504;"&#1500;</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"><font size="2" face="Arial, Helvetica, sans-serif">&#1495;&#1514;&#1497;&#1502;&#1492;_________________________-X</font></div></td>
  </tr>
  <tr> 
    <td colspan="5"><div align="center"> 
        <form name="form1" method="post" >
          <p> </p>
          <p> </p>
          <p> <font face="Arial, Helvetica, sans-serif"></font></p>
          <font face="Arial, Helvetica, sans-serif"> 
          <input type="hidden" name="CustomerFirstName" value="<?php echo $row_RsCommit_form['CustomerFirstName']; ?>">
          <input type="hidden" name="CustomerLastName" value="<?php echo $row_RsCommit_form['CustomerLastName']; ?>">
          <input type="hidden" name="CustomerFirstName_heb" value="<?php echo $row_RsCommit_form['CustomerFirstName_heb']; ?>">
          <input type="hidden" name="CustomerEmail" value="<?php echo $row_RsCommit_form['CustomerEmail']; ?>">
          <input type="hidden" name="CustomerCellphone" value="<?php echo $row_RsCommit_form['CustomerCellphone']; ?>">
          <input type="hidden" name="CustomerHomePhone" value="<?php echo $row_RsCommit_form['CustomerHomePhone']; ?>">
          <input type="hidden" name="CustomerWorkPhone" value="<?php echo $row_RsCommit_form['CustomerWorkPhone']; ?>">
          <input type="hidden" name="CustomerFax" value="<?php echo $row_RsCommit_form['CustomerFax']; ?>">
          <input type="hidden" name="CategoryName" value="<?php echo $row_RsCommit_form['CategoryName']; ?>">
          <input type="hidden" name="CountryName" value="<?php echo $row_RsCommit_form['CountryName']; ?>">
          <input type="hidden" name="CityName" value="<?php echo $row_RsCommit_form['CityName']; ?>">
          <input type="hidden" name="RegionName" value="<?php echo $row_RsCommit_form['RegionName']; ?>">
          <input type="hidden" name="ProductID" value="<?php echo $row_RsCommit_form['ProductID']; ?>">
          <input type="hidden" name="CarRentalRequired" value="<?php echo $row_RsCommit_form['CarRentalRequired']; ?>">
          <input type="hidden" name="TotalNumber" value="<?php echo $row_RsCommit_form['TotalNumber']; ?>">
          <input type="hidden" name="TotalNumberAdults" value="<?php echo $row_RsCommit_form['TotalNumberAdults']; ?>">
          <input type="hidden" name="TotalNumberChildren" value="<?php echo $row_RsCommit_form['TotalNumberChildren']; ?>">
          <input type="hidden" name="children_ages" value="<?php echo $row_RsCommit_form['children_ages']; ?>">
          <input type="hidden" name="RequestText" value="<?php echo $row_RsCommit_form['RequestText']; ?>">
          <input type="hidden" name="Marketing_Source" value="<?php echo $row_RsCommit_form['Marketing_Source']; ?>">
          <input type="hidden" name="Newsletter" value="<?php echo $row_RsCommit_form['Newsletter']; ?>">
          <input type="hidden" name="DepartureDate" value="<?php echo $row_RsCommit_form['DepartureDate']; ?>">
          <input type="hidden" name="ReturnDate" value="<?php echo $row_RsCommit_form['ReturnDate']; ?>">
          <input type="hidden" name="num_nights" value="<?php echo $row_RsCommit_form['num_nights']; ?>">
          <input type="hidden" name="FlightsRequired" value="<?php echo $row_RsCommit_form['FlightsRequired']; ?>">
          <input type="hidden" name="timestamp" value="<?php echo $row_RsCommit_form['timestamp']; ?>">
          <input type="hidden" name="DATETIME" value="<?php echo $row_RsCommit_form['DATETIME']; ?>">
          <input type="hidden" name="proposal_text_1" value="<?php echo $row_RsCommit_form['proposal_text_1']; ?>">
          <input type="hidden" name="status" value="<?php echo $row_RsCommit_form['status']; ?>">
          <input type="hidden" name="AgentName" value="<?php echo $row_RsCommit_form['AgentName']; ?>">
          <input type="hidden" name="AgentUsername" value="<?php echo $row_RsCommit_form['AgentUsername']; ?>">
          <input type="hidden" name="extra_agent_request" value="<?php echo $row_RsCommit_form['extra_agent_request']; ?>">
          <input type="hidden" name="agent_notes" value="<?php echo $row_RsCommit_form['agent_notes']; ?>">
          <input type="hidden" name="supplier_price_per_night" value="<?php echo $row_RsCommit_form['supplier_price_per_night']; ?>">
          <input type="hidden" name="suppplier_comission" value="<?php echo $row_RsCommit_form['suppplier_comission']; ?>">
          <input type="hidden" name="company_price_per_night" value="<?php echo $row_RsCommit_form['company_price_per_night']; ?>">
          <input type="hidden" name="total_price_for_accommodation" value="<?php echo $row_RsCommit_form['total_price_for_accommodation']; ?>">
          <input type="hidden" name="deposit" value="<?php echo $row_RsCommit_form['deposit']; ?>">
          <input type="hidden" name="EUROSHEKEL" value="<?php echo $row_RsCommit_form['EUROSHEKEL']; ?>">
          <input type="hidden" name="CarRentalPrice" value="<?php echo $row_RsCommit_form['CarRentalPrice']; ?>">
          <input type="hidden" name="rent_car_num_days" value="<?php echo $row_RsCommit_form['rent_car_num_days']; ?>">
          <input type="hidden" name="TotalCarRentalPrice" value="<?php echo $row_RsCommit_form['TotalCarRentalPrice']; ?>">
          <input type="hidden" name="TotalFlightsPrice" value="<?php echo $row_RsCommit_form['TotalFlightsPrice']; ?>">
          <input type="hidden" name="finalpriceshekel" value="<?php echo $row_RsCommit_form['finalpriceshekel']; ?>">
          <input type="hidden" name="tourist_tax" value="<?php echo $row_RsCommit_form['tourist_tax']; ?>">
          <input type="hidden" name="FINALCLEANING" value="<?php echo $row_RsCommit_form['FINALCLEANING']; ?>">
          <input type="hidden" name="FINALPRICE " value="<?php echo $row_RsCommit_form['FINALPRICE ']; ?>">
          <input type="hidden" name="PREPAYMENT_company " value="<?php echo $row_RsCommit_form['PREPAYMENT_company ']; ?>">
          <input type="hidden" name="PREPAYMENT2SUPPLIER " value="<?php echo $row_RsCommit_form['PREPAYMENT2SUPPLIER ']; ?>">
          <input type="hidden" name="PAYTOSUPPLIER" value="<?php echo $row_RsCommit_form['PAYTOSUPPLIER']; ?>">
          </font> 
        </form>
      </div></td>
  </tr>
</table>

</body>
</html>
<?php
mysql_free_result($RsCommit_form);
?>
<?php
//url vars:
$urlRID = $_GET['RequestID'];
$urlSupID = $_GET['SupID'];
$urlPID = $_GET['PID'];

$urlpar = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

// submit query to search engine
$url_contents ="http://company_company:companybo@$urlpar ";
$query_file_content = file_get_contents($url_contents, "r") or die("cannot open url");

// save results to a local file
// depending on how your server is configured you may need to give queryfiles folder 777 permission
// could aslo use another file mode to create file i.e. w+
$filenameSV = 'COMMITMENT_FORM_';
$filenameLN = $_GET['LN'];
$filenameRID = $_GET['RequestID'];
$filetype = '.htm';


$file = fopen('../backoffice/createdfiles/'.$filenameSV.''.$filenameLN.''.$filenameRID.''.$filetype.'', 'w+');

fwrite ($file, $query_file_content);

fclose($file);


?>


<?php
/* grabs the POST variables and puts them into variables that we can use */
$RequestID=$_POST['RequestID'];
$CustomerFirstName=$_POST['CustomerFirstName'];
$CustomerLastName=$_POST['CustomerLastName'];
$CustomerEmail=$_POST['CustomerEmail'];

$CustomerCellphone=$_POST['CustomerCellphone '];
$CustomerHomePhone=$_POST['CustomerHomePhone'];
$CustomerWorkPhone=$_POST['CustomerWorkPhone'];
$TotalNumber=$_POST['TotalNumber'];
$TotalNumberAdults=$_POST['TotalNumberAdults'];
$TotalNumberChildren=$_POST['TotalNumberChildren'];
$chidren_ages=$_POST['chidren_ages'];
$RequestText=$_POST['RequestText'];
$CountryName=$_POST['CountryName'];
$CityName=$_POST['CityName'];
$RegionName=$_POST['RegionName'];
$CategoryName=$_POST['CategoryName'];
$DepartureDate=$_POST['DepartureDate'];
$ReturnDate=$_POST['ReturnDate'];
$Marketing_Source=$_POST['Marketing_Source'];
$AgentName=$_POST['AgentName'];
$companyMail='@company.com';
$AgentMail=$AgentName.$companyMail;
$MainMail='[email protected]';

  





  


  $email = $_REQUEST['CustomerEmail'] ;

  if (!isset($_REQUEST['CustomerEmail'])) {
    
   }
  elseif (empty($email)) {
    
  }
  else {
  $url_success = "http://company.com/backoffice/Commit_form_Confirm_heb.php?user=" . $HTTP_GET_VARS['user'] . "";

echo("<meta http-equiv = refresh content=0;url=".$url_success.">");
   mail($to, $subject, $message, $headers); 

  }
?>


 

Link to comment
https://forums.phpfreaks.com/topic/171644-help-optimizing-script/
Share on other sites

I'd re-write all of that if I were you. When's this code dated from? .. I highly doubt you still need to be ensuring that mysql_real_escape_string exists:

 

function_exists("mysql_real_escape_string")

 

Remove that. What are your reasons for setting the send/response character sets every page load? What's the "query_file_content()" function, what code does that contain? Although it's massively bloated, I can't really see why it would cause an error like that. I'm guessing this is a shared server and it doesn't like the amount / size of file operations...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.