Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7009935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:55:34+00:00 2026-05-27T21:55:34+00:00

I have an ad network script like the following http://cdn.domain.com/ad.php?variables=etc We have about 10,000

  • 0

I have an ad network script like the following

http://cdn.domain.com/ad.php?variables=etc

We have about 10,000 hits a second and we are looking at some improvements for our Pseudo code – this is what I have in mind – my question is – would PHP includes slow down my script like the if else codes and would it be worth minifying the PHP on this page:

<?php
// mysql connect
// get variables from publisher
// if publisher has no ads show advertise here banner 
// if resolution from variables is 125x125 show that banner or whatever resolution from the vars
// example www.noadhere.com/image/advertishere_{var}125px.jpg
// if publisher has no ads show advertise here banner and also updated mysql with page views for this publisher

// if publisher has a banner then show it and update mysql with page views
// show also the click code that redirects and updates the record with a hit click
?>

I have updated the code. This is the Phase 1 draft for those who are interested. I think it is so much simpler and I am going to minify this – even though there may not be need – we had 4 mysql actions happening. And now there are 3 – I just made the update views a one liner.

# mysql
$c=mysql_connect("sqlmaster.adserver.com","user","************");
mysql_select_db("adserver", $c);

# vars
$a=mysql_real_escape_string($_GET["z"]);//id
$z=mysql_real_escape_string($_GET["z"]);//zone
$h=mysql_real_escape_string($_GET["h"]);//height
$w=mysql_real_escape_string($_GET["w"]);//width
$d=date("Y-m-d H:i:s");//date
$u=mysql_real_escape_string($_SERVER['HTTP_REFERER']);//url

# constructor

    # do we have ads?
    $r1=mysql_query("");
    if(mysql_affected_rows()==0){

        # empty ad code unit
        echo 'Blog Empty';

    } else {

        # we have ads - so show random click code
        echo 'Click here .php ? and redirect';

    }

    # update mysql view table for this ad unit - empty or filled
    $r2=mysql_query("");

# end constructor
mysql_close($c);

Any suggestions on improving this would be welcomed. I think the mysql_real_escape is slow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:55:35+00:00Added an answer on May 27, 2026 at 9:55 pm

    Using include only slows down your script by the amount of time it takes your server to open the file, which is usually just a fraction of a second. So it wouldn’t drastically slow down your script execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script on a domain (say example.com) and this domain has
In my perl script, I have the param $FILE=/etc/sysconfig/network in which way (in perl)
I have a action.php script from where I call a python script like this:
I'm having perl regex matching problems with a network script I have, I've managed
I have a network C++ program in Windows that I'd like to test for
I have a .cmd script I want to map a network drive based on
I currently have code like this in a web based file called 'view_file.php' to
I have a Python script gathering info from some remote network devices. The output
I have a script that is run over a network, with VPN being the
i have a BASH script that does a few network utilities at home. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.