Slow url processing through the form

  • keoyl
  • Newbie
  • Newbie
  • keoyl
  • Posts: 5

Post 3+ Months Ago

Hi,

I have some old text ad exchange script hosted on shared hosting which uses PHP version 5.3 and MySql 5.1 and have problem with processing referral urls through the form.

Processing referral urls are much slower than processing normal urls so I don't understand why. For example if I put normal url like
Code: [ Select ]
mysite(dot)com
processing is very fast, but if I put referrer url like
Code: [ Select ]
mysite(dot)com/referrer=2
I'm getting slower respond. I'm getting slower respond even if I put just slash (/) on the end of normal url like
Code: [ Select ]
mysite(dot)com/


Don't believe the problem is in code because like I said it works with normal url. It also worked on previous PHP version (5.2) and MySql version (5.0).

I tested the page loading sped when put normal and referrer url. The speed of loading the page when I put a normal url is less than 1 sec (269msl) and when I put referrer url the loading was more than 9 seconds (9594msl). This was tested with Firefox, Web Console.

Does anyone knows where can be a problem?
Thank you,
Ivan.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1241
  • Loc: Sydney

Post 3+ Months Ago

is your code validated, so it knows what is being processed?
  • keoyl
  • Newbie
  • Newbie
  • keoyl
  • Posts: 5

Post 3+ Months Ago

Zealous wrote:
is your code validated, so it knows what is being processed?


When you say validated you mean does it check is it posted?
Here is all code so please you tell me.

Code: [ Select ]
<?php

session_start();

include "memberheader.php";

$name = $_POST['name'];

$id = $_POST['id'];

$bannerurl = $_POST['bannerurl'];

$targeturl = $_POST['targeturl'];

$done = $_POST['done'];



if( session_is_registered("ulogin") ) {

?>
<div id="wrapper">
    <div id="content">
        
  <div id="content_top">
    <h1>Edit Banner</h1>
    </div>
<?

  include("navigation.php");



  if ($done == "YES") {

        if (empty($name)){

            ?> <h4>No name entered. Click <a href=editbanners.php>here</a> to go back</h4> <?

            exit;

      }

        if ($bannerurl=="" or $bannerurl=="http://"){

            ?><h4>No banner url entered. Click <a href=editbanners.php>here</a> to go back</h4> <?

            exit;

      }

        if (substr($bannerurl, 0,7)!= 'http://') {
        ?><h4>You must put a valid image url. Click <a href=editbanners.php>here</a> to go back</h4> <?

            exit;

      }
        
        if ($targeturl=="" or $targeturl=="http://"){

            ?><h4>No target url entered. Click <a href=editbanners.php>here</a> to go back</h4> <?

            exit;

      }

        if (substr($targeturl, 0,7)!= 'http://') {
        ?><h4>You must put a valid target url. Click <a href=editbanners.php>here</a> to go back</h4> <?

            exit;

      }


      $query = "update banners set name='$name', targeturl='$targeturl', bannerurl='$bannerurl', added=1, status=0 where id=".$id;

      $result = mysql_query ($query)

           or die ("Query failed");

      ?>

           <br /><h3>Your banner has been edited, <a href="postbanners.php">click here</a> to go back.</h3>

      <?

  }

  else {

      ?>

        <center><br>
      <form method="POST" action="editbanners.php">

      <h1>Banner Name:</h1><div id="form_members">

      <input type="text" name="name" style="text-align: center; height: 30px" size="25" maxlength="15" value="<? echo $name; ?>"></div><br>

      <h1>Banner Image URL:</h1><div id="post_ad_form">

      <input type="text" name="bannerurl" style="text-align: center; height: 30px" size="70" maxlength="75" value="<? echo $bannerurl; ?>"></div><br>
        
        <img src="<? echo $bannerurl; ?>" alt="Your banner preview."><br>

      <h1>Target Url:</h1><div id="post_ad_form">

      <input type="text" name="targeturl" style="text-align: center; height: 30px" size="70" maxlength="75" value="<? echo $targeturl; ?>"></div>

      <input type="hidden" name="id" value="<? echo $id; ?>">

      <input type="hidden" name="done" value="YES">
        <div id="button_member">
      <input type="submit" value="Save" style="text-align: center; height: 26px" class="btn"></div>

      </form>
        </center>
        

      <?
        
        

  }
echo "</td></tr></table>";
 }

else

 { ?>



 <h4>You must be logged in to access this site. Please <a href="../index.php">click here</a> to login.</h4>



 <? }

?>


</div>
</div>

<?

include "../footer.php";

mysql_close($dblink);

?>
  1. <?php
  2. session_start();
  3. include "memberheader.php";
  4. $name = $_POST['name'];
  5. $id = $_POST['id'];
  6. $bannerurl = $_POST['bannerurl'];
  7. $targeturl = $_POST['targeturl'];
  8. $done = $_POST['done'];
  9. if( session_is_registered("ulogin") ) {
  10. ?>
  11. <div id="wrapper">
  12.     <div id="content">
  13.         
  14.   <div id="content_top">
  15.     <h1>Edit Banner</h1>
  16.     </div>
  17. <?
  18.   include("navigation.php");
  19.   if ($done == "YES") {
  20.         if (empty($name)){
  21.             ?> <h4>No name entered. Click <a href=editbanners.php>here</a> to go back</h4> <?
  22.             exit;
  23.       }
  24.         if ($bannerurl=="" or $bannerurl=="http://"){
  25.             ?><h4>No banner url entered. Click <a href=editbanners.php>here</a> to go back</h4> <?
  26.             exit;
  27.       }
  28.         if (substr($bannerurl, 0,7)!= 'http://') {
  29.         ?><h4>You must put a valid image url. Click <a href=editbanners.php>here</a> to go back</h4> <?
  30.             exit;
  31.       }
  32.         
  33.         if ($targeturl=="" or $targeturl=="http://"){
  34.             ?><h4>No target url entered. Click <a href=editbanners.php>here</a> to go back</h4> <?
  35.             exit;
  36.       }
  37.         if (substr($targeturl, 0,7)!= 'http://') {
  38.         ?><h4>You must put a valid target url. Click <a href=editbanners.php>here</a> to go back</h4> <?
  39.             exit;
  40.       }
  41.       $query = "update banners set name='$name', targeturl='$targeturl', bannerurl='$bannerurl', added=1, status=0 where id=".$id;
  42.       $result = mysql_query ($query)
  43.            or die ("Query failed");
  44.       ?>
  45.            <br /><h3>Your banner has been edited, <a href="postbanners.php">click here</a> to go back.</h3>
  46.       <?
  47.   }
  48.   else {
  49.       ?>
  50.         <center><br>
  51.       <form method="POST" action="editbanners.php">
  52.       <h1>Banner Name:</h1><div id="form_members">
  53.       <input type="text" name="name" style="text-align: center; height: 30px" size="25" maxlength="15" value="<? echo $name; ?>"></div><br>
  54.       <h1>Banner Image URL:</h1><div id="post_ad_form">
  55.       <input type="text" name="bannerurl" style="text-align: center; height: 30px" size="70" maxlength="75" value="<? echo $bannerurl; ?>"></div><br>
  56.         
  57.         <img src="<? echo $bannerurl; ?>" alt="Your banner preview."><br>
  58.       <h1>Target Url:</h1><div id="post_ad_form">
  59.       <input type="text" name="targeturl" style="text-align: center; height: 30px" size="70" maxlength="75" value="<? echo $targeturl; ?>"></div>
  60.       <input type="hidden" name="id" value="<? echo $id; ?>">
  61.       <input type="hidden" name="done" value="YES">
  62.         <div id="button_member">
  63.       <input type="submit" value="Save" style="text-align: center; height: 26px" class="btn"></div>
  64.       </form>
  65.         </center>
  66.         
  67.       <?
  68.         
  69.         
  70.   }
  71. echo "</td></tr></table>";
  72.  }
  73. else
  74.  { ?>
  75.  <h4>You must be logged in to access this site. Please <a href="../index.php">click here</a> to login.</h4>
  76.  <? }
  77. ?>
  78. </div>
  79. </div>
  80. <?
  81. include "../footer.php";
  82. mysql_close($dblink);
  83. ?>

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.