Suddenly Started Running Slow!
So the other day, I was fiddling with the php.ini file on my web server trying to figure out why my 30mb file wasn't uploading, so I started changin some settings and then tried to upload my file again...
Out of nowhere, the php script started taking forever to execute!
you can see it here: ....
View Complete Forum Thread with Replies
Related Forum Messages:
PHP Running Way To Slow T_T
About an hour ago my pages were taking around 0.01 seconds to load. Now those same pages are taking like 5.00 seconds to load. CPU usage is 1% Why are they going so slow all of a sudden? Even pages that I have not edited at all whatsoever in any way are suddenly slow as poop when they used to be loading instantly an hour ago! Code:
View Replies !
Mysql Running Slow
I'm a php guy and db system issues are not my thing. My server (linux) is running mysql 4.0.15, and running SLOW, very slow. I did a search for the slow query log file that the docs mention but could not find it. I have started changing the file types to myisam from innoDB. I'm wondering if the system is screwed up becuase the size of ibdata1 (where innodb data is stored) is 1344274432 bytes (about 1.1 GB), but as I convert tables from innodb to myisam (lots of them with lots of data), the file size of ibdata1 is not going down.
View Replies !
Site Running Slow Transferring To HTTPS
I have an intermittent issue with my site in that, at times, it runs really, really slow when it transfers from http to https. The server administrators says there's no problem their end so I'm kinda stumped, as it runs fine most of the time, then for a couple of hours on some evening or weekend, any request has about a 10% chance of getting onto the next (secure) page. The page takes forever and might eventually load after a few minutes. I'm not running any cron jobs at the time, I think I've ruled out network attacks. This happens with the public https pages. The password protected, back-end https pages seems slow, but still get there. So really what I'm asking is this: Are there any inherent pitfalls to look out for at that point of transferring from http to https?
View Replies !
Database Suddenly Will Not Connect
I was testing my site, everything was working fine, I go to get a drink and come back and now it says cannot connect to the server. I didnt touch any of the code I dont know whats going on but it is really frustrating me. Anyone know what may have happened?
View Replies !
SQL Statements Suddenly Exposed
I have a server with PHP 4.3.8 and MySQL on Redhat Fedora running Apache. Recently sql statements just started showing up on all the pages. I don't recall making a change that would output those queries, but I have had a few late nite coding sessions. I can't find any instances of returns or echo's that would return every query. My question is: are there exploits or hacks that could have occured on my system that would cause this behavior? Something like a php.ini or mysql ini setting to expose all queries?
View Replies !
Form Variables Suddenly Undefined
Hostway swears they didn't do anything but mysterious breakdowns have made us do the following test: <? if ($_POST) { echo "<h3>name is defined as $name</h3>"; print_r($_POST); exit; } ?> <form name="form1" method="post" action="test.php"> <input name="name" type="text" id="name"> <input type="submit" name="Submit" value="Submit"> </form> This produces: name is defined as Array ( [name] => fellow [Submit] => Submit ) So $_POST has the defined var but $name is no longer automatically defined. What did they do to the configuration?
View Replies !
Suddenly Behaviour Changed When Using Firefox To Do The Uploads.
Not sure if this is really a problem related to PHP or not, but here goes anyway. I'm in the process of writing a script (PHP5) that uploads text files to the server. All was working fine, and then suddenly behaviour changed when using Firefox to do the uploads. The file type ($_FILES['userfile']['type']) for the text files is being set by Firefox as 'application/x-download' instead of 'text/plain'. IE6 is fine when running exactly the same pages/scripts it sends them as 'text/plain'.
View Replies !
Warning: Invalid Argument Supplied For Foreach() Running On A OS X Machine Running Apache 1.x And PHP 4.x.
The following script was running on a OS X machine running Apache 1.x and PHP 4.x. I just moved the script over to a Linux machine running Apache 2.0.51 and PHP 4.3.8, and now the foreach line does not work. It says Warning: Invalid argument supplied for foreach() in /var/www/localhost/htdocs/warehouse/whse_order_submit.php on line 39 Here is the script: <?php //get the variables from the other page $id=$_POST['id_no']; $sku=$_POST['sku']; $description=$_POST['description']; $order=($_POST['order_qty']); $store=$_POST['store']; $comment=$_POST['comment']; $ip=$REMOTE_ADDR; //check if store is empty if(empty($store)) { die("Store is required. Please press the back button and enter in your store."); } //connect to the database require('../inc/database_conn.php'); //$month=getdate(mon); //$day=getdate(mday); //$year=getdate(year); //$today=$year . "-" . $month . "-" . $day $today=date('Y-m-d'); // create the unique order number $headerqry = "INSERT INTO misc_order_header (order_date, store, comment, ip) VALUES ('$today', '$store', '$comment', '$ip')"; mysql_query($headerqry, $conn) or die(mysql_error()); $order_no=mysql_insert_id(); foreach($order_qty as $id_no => $val) { if($order_qty[$id_no] > 0) { $detailqry = "INSERT INTO misc_order_detail (order_no, id_no, sku, order_qty, order_date, store) VALUES ('$order_no', '$id_no', '$sku', '".$order_qty[$id_no]."', '$today', '$store')"; mysql_query($detailqry, $conn) or die(mysql_error() . "<BR>" . $detailqry); } }
View Replies !
Getting Started
I am currently attempting to build a site where you can register with your 360 gamertag and then create guilds/clans and whatever. So does anyone have any tips for me on how to even get started?
View Replies !
Started PHP
i gotta admit last for mouth's ive been round other forum's but ive alway's come back to this one of course is the best , i need to get my idea's book up now. only been moveing to forum to forum cos im a big big big, newble with coding anyway.Right as you may know may of forgot a few mouth's ago i wanted to make a mmorpg game, text-based. Mafia style game. but as i have relized im not gonna learn some codeing (php) and be able to make it like that! i will need to learn research for mouth's and mouth's i know this! but i really need some good sites to learn. PHP.net is a good tut site but im a really newblw and it's far to complex for me. maybe ill get a book. and read it. but, with some site's i've been on when reading it i get really bored and stop reading and go on to play game's and i know i like coding cos when i was doing some javascript i enjoyd doing some alert stuff i know it's really easy but i enjoyd makeing it, just really dont enjoy learning it. (lol).
View Replies !
Cant Get Started
i've downloaded php installer from php.net i've installed it on my computer and i want to try it without a server i'm using front page to creat my html pages and i want to use it to creat html pages containing php codes. is that available? when i try to do so i dont know how to save it with the .php extention i also dont know how to browse it shall i open it with the explorer or just a double click on the file.
View Replies !
How To Get Started In PHP
in general I am a newbie to web design, but am very interested in learning all that I can. I wish I had some kind of formal training, but financially it's just not an option. So I'm trying to learn as much as I can on my own via the internet. So here's my dilemma, I'm creating a family website and want to add a bloggers page. I downloaded what seems to be a pretty cool PHP blog, but since I know nothing about PHP, I don't know what I'm supposed to do with the files. The blog is MyBloggie 2.1.2 if that helps. Can anyone point me in the right direction on how to utilize this.
View Replies !
Getting Back To Where I Started.
I use a login script and since it's accessable from every page on my site I would like the user to go back to the place where he started. I use a template file in which the loginfields are placed and where I call a different .inc for each other page, so it doesn't make sense to hard code the 'gobackurl', is there a function to retrieve the pageurl from where the user came or another solution, let me know?
View Replies !
Problem Getting Started
I was just wondering if anyone can just help me get started with PHP (with My SQL). I've installed these on my home PC (together with Apache web server as a local host), but when I navigate to the "test.php" file in my browser, I just get the file opening in Notepad. I'm sure it was appearing in the browser correctly last week when I tried. Any ideas? I'm pretty sure I've configured the Apache httpd.conf file correctly. My SQL starts on StartUp (showing as a green light in the system tray) so that can't be the problem - and http://localhost is displaying the Apache test page ok in the browser.
View Replies !
How To Get Started With Web Services?
I have a project that would be perfect to use a web services architecture. Although I've never done anything with web services. I've been doing quite a bit of reading on how to create a web service with PHP and I got about 10 different ways to do them. So my question is, what is the absolute best way to create a web service using PHP. Do you know of any good books, article, tutorials, etc. that would help with this issue? I just need to be pointed in the right direction so I can start reading and playing around with them.
View Replies !
Getting Started - Not Quite Working
I've got Apache up and running also PHP and edited the httpd.conf and php.ini as recommended(by ricocheting.com). Problem is as soon as I have a single or double quote,all PHP after that just gets dumped to the browser even though I do of course close the quote.
View Replies !
SESSION STARTED
im trying to learn php and when i was installing openbooking i got it instaled and when i type the username and password in it just says Notice: A session had already been started - ignoring session_start() in c:program fileseasyphp1-8wwwsystemsession.php on line 2 does anyone know how i can get round this .
View Replies !
Getting Started With Fucntions
I'm trying to tidy up a lot of code that repeated. for example, I wrote a phpscript that exports data to a pdf file rather messily, there is a lot of repeated code so as an example, i put the header in to a function as such ; Code:
View Replies !
A Session Had Already Been Started
I have a permission file I include at the top of each page in my application that I am use to do the session_start() and check for the session. I am getting an error that shows on each page though that says: PHP Notice: A session had already been started - ignoring session_start() in C:DATAhtdocsincludespermissionsuniversal.php on line 2 The page runs fine, but the error shows. I tried searching for an answer, but the query in the search box was freaking the site out.
View Replies !
Getting Started With Ajax
I just completed putting up a pretty simple game site that uses php for everything (almost everything). The game is opensource and written by others. I consider myself at rookie at php, and was capable of modifying the game a little bit with some of great help from all of the members here. The game constantly sends queries to the database, and then will refresh the screen. I know this is a pretty open ended question, and I just bought a book to begin reading this weekend. But I am curious to peoples thoughts on the difficulty level in incorporating ajax into existing php scripts? Something a php rookie should be able to figure out?
View Replies !
Getting Started On Php And Downloading
I would like to learn php and i only the only language is html and i would like to become a designer of web pages,and i see alot of pages using php,am a novice i tried down loading it and i can't find it,and what does it mean to have a server on your computer.
View Replies !
Getting Started With PEAR
I have been coding for almost 40 years, but only two months with php. I found www.php.net and it has a lot. I downloaded ZipCodeRange and it called for stuff, including DB.php. I was directed to look at pear.php.net. I did that, and started reading the manual. What I cannot seem to find is how to SIMPLY use this stuff. a - I don't know where to find db.php b - I haven't been able to find an explanation of the syntax (e.g. DB::connect) c - How to actually USE the class. Can someone help me out with some simple instructions to get started? Once I am moving I can take it from there.
View Replies !
Session Expired Or Never Started?
I have some code at the top of each page that says session_start() then checks for a value in the session. If the person never logged in the session is empty and they get bounced to the login page. But if the person has been sat at a normal page for 15 minutes after logging in, session_start() works as if a session ID has not been presented, starts a new session which is empty and the user gets bounced to the login page! I feel like I've missed a step. How can I tell if a user doesn't have a valid session ID because they've never logged in, or whether they don't have a valid session ID because their session has timed out?
View Replies !
Getting Started - Gui And File Organisation
preamble: I have a lot of my php rolling now, and it looks very exciting; sow sorry to ask such dim questions, but I wonder if you could point me in the right direction for the following: 1. how do you do loads of user input ? it does not look like there are a lot of functions for user buttons and input fields; do you 2. mix php with another user gui inout language ? I was about to code up php inside html actions (I'm new to html too!) 3. how do you organise you files ? and make functions able to skip accross them.
View Replies !
Sessions Started Going Weird.
i installed WAMP server on my pc, and started coding as always. I noticed that sessions started going weird. I declare a session in page1 for example, I echo it in page2 after a form submission ... al goes fine ... then click a link on page2 leading to page 3 ..... the session is no longer valid. echoing the session gives NULL What's wring? I am using session_start(); in all 3 pages.
View Replies !
Started My Regex Immersion
I started (long time overdue) to take a deep immersion in regex but cannot figure out the answer to some questions: For example What that /U stands for? preg_replace('/<a.*href="([^"])/U', '../$1', $url); does it regard only the first uppercase character or all uppercases or something else? I found a way to grasp the concept: 1) Trying to understand the tutorialsSSS (so many!) 2) And when writing or reading a sample I read it but translate it in pure English if it does not make sense or does not seem to be logical then something got to be wrong.
View Replies !
Security In An Process Started With Exec
The php script that processes user input from a form, starts a new process using exec. In my case, the process may contain arbitrary, user defined functionality. How do I ensure that that process doesn't do any harm? Is there a way to define a sort of sandbox that the process can run in, so it won't be able to access any unauthorized resources, or do some other damage to the server? I am running PHP 5.1.2 on Apache 2, on Win XP Pro. Thanks, A
View Replies !
How To Get An Unix Programmer Started On Web Programming?
I've done lots of programming for CAD, which was basically C/C++ and tcl/tk. Now, we are thinking about introducing more web based tools, programming them ourselves and right now the toolchain we think about is apache/oracle/php. Now, I can do oracle no problem but I'm pretty wet behind the ears about everything else. What books could you recommend to me so that I can learn: - what all this apache stuff is about, the mod_* - what html or xml looks like, what a css and a dtd is and what I need it for - session management - login through active directory - php I've thrown my eyes on the php5 and mysql bible (ok it's not oracle but the mysql part is 150 out of 1000 pages and the rest looks good from the table of contents). But what about the other stuff?
View Replies !
How To Kill Process Started By User?
Let us suppose that PHP file contains cycle which will never stop. For example: while ( 2==2 ) { some usage of database; } User which opens this PHP page runs time consuming execution of the cycle. My question is whether this execution will be automatically stopped after user closes the PHP file (or closes his browser). I suppose that answer is "No", since PHP is server-side application. How than I can find such processes and kill them by hands?
View Replies !
Trouble Getting Started With PHP/MySQL On 5gbfree.com
Background: A few days ago I was browsing <www.free-webhosts.com>, specifically <http://www.thefreesite.com/Free_Web_Space/>, where it lists <http://www.5gbfree.com/which allows 3GB of Web space plus 10 MySql databases! I tried to get an account there, but I can't see the letters in the box (CAPTCHA) because my access is text only. (Details of my situation: <http://www.rawbw.com/~rem/NewPub/mySituation.html>) But earlier today I briefly got full net access at a local computer lab that was just about to close for the day, so I was able to complete my registration. I now have my own 5gbfree.com site. I was able to create a database called test1, a user called self, and set up priviledge for that user to use that database, except I have no idea how to check if it really worked, because my test script doesn't work: <? $user="calrobert_self"; $password="..."; $res = mysql_connect(localhost,$user,$password); echo "res = $res<br>"; $database="test1"; @mysql_select_db($database) or die( "Unable to select database $database"); mysql_close(); ?> It returns a empty result from mysql_connect, and it dies unable to select the database test1. I tried to join the newbie forum they have, but it requires javascript, which isn't available here. I did a Google search to try to find any previous mention of 5gbfree, but there's nothing except spam from a user that apparently has been terminated from 5gbfree because when I try to connect to that user's Web site I get redirected to 404.php and from there to the main greeting page for 5gbfree.com. So does anybody know anyone who already has an account on 5gbfree.com who could tell me how to diagnose the problem I'm having with PHP/MySQL access? Or just somebody with general PHP/MySQL ObNit: No, my password isn't "...". I omitted it here for obvious reasons. But in the actual script the correct password is there, AFAIK, I don't know how to verify that the password I set up matches the password I'm trying to use in this PHP script. I tried changing the password in the script to be incorrect, but the result is the same, null result (printing as empty string, i.e. nothing printed at all there) in $res. I also changed the $user to be a bogus value, and still there's no change in the output. I have no idea whether it's failing to find the user, or failing to match the password, or failing to find the database, or failing to allow that user to get access to that database.
View Replies !
Proc_open Hangs When Started Process Crashes
I'm using proc_open to start a process on a WindowsXP server. If the process that I start crashes for some reason, the whole PHP parsing hangs. When opening the TaskManager I can see my process still exists, meaning it actually hasn't ended although it crashed. any ideas how to solve this?
View Replies !
Slow Down
I have written this script, which connects to a mysql data base.. and receives results from it..but for some reason, it has become very slow when loading... any ideas on how to pin point why such things happen?
View Replies !
Slow PHP On IIS 6
I have PHP 4.3.1 running under IIS 6, when i access my website PHP is verly slow but when i access my website on my server using http://localhost/mysite/ php is very fast.
View Replies !
PHP 5 - XSL Slow?
I've just installed PHP 5 under Fedora Core 2 and I've been having speed problems with xsl and the dom functions. Previously I used the sablotron extension functions under PHP 4 with script execution times of under 5 seconds ( max of 0,2M xml files, with a fair number of xsl:key statements). Under PHP 5 execution times almost seem random and never seem to use the full system resources (memory-limit wasn't included as a compile option) -- script execution times are often ten times longer that under PHP 4. Has anybody else encountered problems with these functions and/or is there a way to tell PHP to stop pussy-footing around and use the system resources available to it (this isn't a shared environment)?
View Replies !
Cli Seems Very Slow
Anyone else have this issue? Even if I write a simple hello world! script with a shebang and run it, there seems to be a half a second or so delay before I get my response. Code:
View Replies !
Slow Code. Could I Do This Better?
I have a page that serves as a calendar for an object. On this page theres a section that automaticaly generats every day in the selected year, in a month by month fassion. What I'm trying to acomplish is to set bgcolor to green if the object is vacant, and red if not. I get this to work, but it's paintaking slow the way I do it. wich is: PHP Code:
View Replies !
Help..PHP/APACHE Slow
Have compiled PHP 4 with MySQL support into my Apache 1.23.32 server. It works great but I've noticed it drastically slows down the speed at which the pages load. I would expect a php script with a DB query to be slower, but this goes for almost 10 seconds or more on the same network. HTML zaps onto the screen real quick.Is there a way I can make the server respond faster?
View Replies !
Slow Loading
I recently moved to a new server. I've noticed that index.php (first page anyone sees) is extremely slow to load. On the old server it loaded fast. The servers have the same specs. What could the issue be?
View Replies !
File() Too Slow
I am trying to process a CSV file but am having trouble with my hosts maximum execution time of 30 seconds. This is how the script works at the moment. User uploads their CSV file The script goes through the file() and writes smaller chunk files. The script then goes through processing the smaller files, populating the database, deleting the processed file and refreshing itself, thus starting again. This system works for files up to 15000 rows, but I need to be able to process larger files. The bottleneck is with the initial splitting, since I use the file() function to read the entire uploaded file. Does anyone know a quicker way to split a file into smaller chunks.
View Replies !
PHP And Ajax - Very Very Slow
PHP and Ajax - very very slow How do you people use PHP with Ajax? I have been using this code, but there must be something wrong because it takes too long to get the answer from the server. I really need, somehow, to check if the IE version is 5. The main point is: where there more than 500 people connected to the DB it becomes really slow. Ajax code: var agt = navigator.userAgent.toLowerCase(); var isIe = (agt.indexOf('msie') != -1); var isIe5 = (agt.indexOf('msie 5') != -1); var uniqueCounter = (new Date).getTime(); function createXmlHttpReq(handler) { if (isIe) { var control = (isIe5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"; try { xmlhttp = new ActiveXObject(control); xmlhttp.onreadystatechange = handler; } catch (e) {} } else { xmlhttp = new XMLHttpRequest(); xmlhttp.onload = handler; xmlhttp.onerror = handler; } return xmlhttp; } function xmlHttpGET(xmlhttp, url) { xmlhttp.open('GET', url, true); xmlhttp.send(null); } function xmlHttpPOST(xmlhttp, url, arg) { xmlhttp.open('POST', url, true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-Length", arg.length); xmlhttp.setRequestHeader('Connection','close'); xmlhttp.send(arg); } function sendRequestGET(url) { xmlhttp = createXmlHttpReq(function() {}); xmlHttpGET(xmlhttp, url); } function sendRequestPOST(url, arg) { xmlhttp = createXmlHttpReq(function() {}); xmlHttpPOST(xmlhttp, url, arg); } ======================================================================== My JavaScript in .php file (example): ... function GetPerfilIndividual(id){ var arg = 'SOMETHING=1&SOME_ID=4343"; var xmlhttp = createXmlHttpReq(function() { if(xmlhttp.readyState == 4) { if(xmlhttp.status == 200) { document.getElementById("DIV_DEST").innerHTML = xmlhttp.responseText; } else { document.getElementById("DIV_DEST").innerHTML = "<font color='red'>"+xmlhttp.status+" - "+xmlhttp.statusText+"</font>"; } } }); xmlHttpPOST(xmlhttp, 'my_php_file.php', arg); } ... my_php_file.php - Access the database - make about 8 SELECTs - create some TABLEs - closes database - return
View Replies !
Php::xml_parse Really Really Slow
I have a website that is generated on the fly from XML templates. I've been having some performance issues (pages taking 6 seconds or more to be generated) and profiled the php code. (This is an embedded system with a slow CPU.) It turns out that php::xml_parse is very, very slow. My XML stuff isn't that complex, but only 4 calls to xml_parse account for 1/2 of the time it takes to generate the page. Anyone know of a way to improve XML performance? I don't need ereg/preg support, or anyting like that, but I have to get the xml_parser to run faster.... This is my configure script: ../configure --host=arm-linux --target=arm-linux --build=i686-pc-linux-gnu --with-zlib-dir=$ROOTDIR/$PLATFORM/lib --with-ming=$ROOTDIR/../src/ming-0.3.0 --disable-all --enable-session --enable-xml --enable-sockets --enable-fastcgi --enable-ming --enable-xdebug --enable-force-cgi-redirect --with-config-file-path=/etc --prefix=/ --exec-prefix=/bin
View Replies !
Why Is This Script So Slow?
This script runs fine, but I'd like to know why it's so slow.. Thanks for any help out there on how i can make it faster (it might take up to 5 min to write these 3 export files whith 15 records each!!!) ==================== <style> body, table, tr, td { font-family: 'verdana' font-size: 12px; } td.header { font-weight: bold; background-color: #cccccc; } </style> </head> <body> <br><br><br><br><center>Creating Export Files<br><br>Please be patient.</center><br><Center> <? flush(); $db = mysql_connect("localhost", "stickerguy", "PASWORDHERE!"); mysql_select_db("stickerguy",$db); // Create contact.tab which is a tab delimated list of customer numbers names, address, email // order write old file // Open contact.tab $file_name = "/home/biz/stickerguy/WWW/stickerguyadmin/contact.tab"; $logfile = fopen($file_name, "w+") or die("Couldn't create new file"); echo "<br>contact.tab "; flush(); // Get all customer numbers $results = mysql_query("SELECT DISTINCT custnumber.ID AS customer_number, orders.custid FROM orders, custnumber WHERE orders.custid = custnumber.scratch AND imported = 0 AND (STATUS = 'payment received' OR STATUS = 'paypal billing complete') ORDER BY custnumber.ID", $db); while ($custnumber = mysql_fetch_array($results)) { $results2 = mysql_query("SELECT * from customer where custid = ".$custnumber["custid"]); $customer = mysql_fetch_array($results2); fwrite($logfile, $custnumber["customer_number"]." ".$customer["name"]." ".$customer["company"]." ".$customer["address"]." ".$customer["state"]." ".$customer["zip"]." ".$customer["email"]." "); echo "."; flush(); } fclose($logfile); // Create phone.tab which is a tab delimated list of customer numbers and phone numbers // over write old file // Open phone.tab $file_name = "/home/biz/stickerguy/WWW/stickerguyadmin/phone.tab"; $logfile = fopen($file_name, "w+") or die("Couldn't create new file"); echo "<br>phone.tab ."; flush(); // Get all customer numbers $results = mysql_query("SELECT DISTINCT custnumber.ID AS customer_number, orders.custid FROM orders, custnumber WHERE orders.custid = custnumber.scratch AND imported = 0 AND (STATUS = 'payment received' OR STATUS = 'paypal billing complete') ORDER BY custnumber.ID", $db); while ($custnumber = mysql_fetch_array($results)) { $results2 = mysql_query("SELECT * from customer where custid = ".$custnumber["custid"]); $customer = mysql_fetch_array($results2); if ($customer["phone"] != "") { fwrite($logfile, $custnumber["customer_number"]." ".$customer["phone"]." HOME "); } if ($customer["fax"] != "") { fwrite($logfile, $custnumber["customer_number"]." ".$customer["fax"]." FAX "); } echo "."; flush(); } fclose($logfile); // Create order list HTML file // Open orderlist.html $file_name = "/home/biz/stickerguy/WWW/stickerguyadmin/orderlist.html"; $logfile = fopen($file_name, "w+") or die("Couldn't create new file"); echo "<br>orderlist.html ."; flush(); fwrite($logfile, "<html> <head> <title>Order List</title> "); fwrite($logfile, "<style> "); fwrite($logfile, "td {font-family: Verdana; font-size: 10px;} "); fwrite($logfile, "td.leftbox { font-family: Verdana; font-size: 10px; background-color: #E8E8E8; } "); fwrite($logfile, "td.box1 { font-family: Verdana; font-size: 10px; background-color: #CCCCCC } "); fwrite($logfile, "td.box2 { font-family: Verdana; font-size: 10px; background-color: #EEEEEE; } "); fwrite($logfile, "</style></head><body> "); // Get list of all needed customer numbers for order list $results = mysql_query("SELECT DISTINCT custnumber.ID AS customer_number, custnumber.grandtotal, orders.custid FROM orders, custnumber WHERE orders.custid = custnumber.scratch AND imported = 0 AND (STATUS = 'payment received' OR STATUS = 'paypal billing complete') ORDER BY custnumber.ID", $db); // Loop thru customer number building table each time while ($custnumber = mysql_fetch_array($results)) { $results2 = mysql_query("SELECT * from customer where custid = ".$custnumber["custid"]); $customer = mysql_fetch_array($results2); $results3 = mysql_query("select * from orders where custid = ".$custnumber["custid"]); $order = mysql_fetch_array($results3); fwrite($logfile, "<table cellspacing=2 cellpadding=2 width=750 height=185 border=0> "); fwrite($logfile, "<tr>"); fwrite($logfile, "<td rowspan=3 class=leftbox valign=top><b>Customer #".$custnumber["customer_number"]."</b><br><br>".$order["orderdate"]."<BR><BR>".$customer["name"]."<br>".$customer["address"]."<br>".$customer["city"].", ".$customer["state"]."<BR>".$customer["zip"]."<BR><BR>".$customer["email"]."<BR>ph: ".$customer["phone"]."<br>fx: ".$customer["fax"]."</td> "); fwrite($logfile, "<td class=box1> "); fwrite($logfile, "<table cellpadding=2 border=0 width=100%> "); fwrite($logfile, "<tr> "); fwrite($logfile, "<td><b>Payment Method:</b></td> "); if ($order["status"] == "paypal billing complete") { fwrite($logfile, "<td>Pay Pal</td> "); } if ($order["status"] == "payment received") { fwrite($logfile, "<td>Check/Mail</td> "); } fwrite($logfile, "<td><b>Payment Amount:</b></td> "); fwrite($logfile, "<td>$".$custnumber["grandtotal"]."</td> "); fwrite($logfile, "</tr> "); fwrite($logfile, "<tr> "); fwrite($logfile, "<td><b>Requested Deadline:</b></td> "); fwrite($logfile, "<td colspan=3>".$order["deadline"]."</td> "); fwrite($logfile, "</tr> "); fwrite($logfile, "</table> "); fwrite($logfile, "</td> "); fwrite($logfile, "<tr><td class=box2> "); fwrite($logfile, "<table cellpadding=2 border=0 width=100%> "); $results4 = mysql_query("select * from orders where custid = ".$custnumber["custid"]); while($orders = mysql_fetch_array($results4)) { fwrite($logfile, "<tr> "); fwrite($logfile, "<td><b>".$orders["project"]."</b></td> "); fwrite($logfile, "<td>".$orders["quantity"]." ".$orders["ordertype"]." ".$orders["size"]."</td> "); fwrite($logfile, "<td> "); if ($orders["vinyl"] != "") { fwrite($logfile, "Vinyl: ".$orders["vinyl"] . " "); } if ($orders["color1"] != "") { fwrite($logfile, "Color1: ".$orders["color1"] . " "); } if ($orders["color2"] != "") { fwrite($logfile, "Color2: ".$orders["color2"] . " "); } if ($orders["color3"] != "") { fwrite($logfile, "Color3: ".$orders["color3"] . " "); } if ($orders["color4"] != "") { fwrite($logfile, "Color4: ".$orders["color4"] . " "); } fwrite($logfile, "</td> "); fwrite($logfile, "<td>Artwork ".$orders["os"]." ".$orders["software"] . " " . $orders["filename"] . "</td> "); fwrite($logfile, "</tr> "); } mysql_query("update orders set imported = 1 where custid = ".$custnumber["custid"]); fwrite($logfile, "</table> "); fwrite($logfile, "</td></tr> "); fwrite($logfile, "<Tr><td class=box1>" . $customer["notes"] . "</td></tr> "); fwrite($logfile, "</table> "); fwrite($logfile, "<hr color=black width=750> "); echo "."; flush(); } fwrite($logfile, "</body></html>"); // Output links to each of the above 3 files. ?> </center> <Br><br> <center> <a target="new" href="contact.tab">contact.tab</a><br> <a target="new" href="phone.tab">phone.tab</a><br> <a target="new" href="orderlist.html">orderlist.html</a><br> <Br><br> Right click the above links and click "save as" or "save target as" to save the files. <Br><Br> Orders have been marked as processed. </center> </body> </html>
View Replies !
PHP Slow To Execute
I have some PHP pages at.. which is exhibiting some strange slowness. It is hosted by secureserver.net (bad?). When I time how long it takes to load the main web page from the server it averages 7 seconds, but often goes to 15. When I store the main page on my hard drive, the load time is 1 second. I've tried removing PHP code that might slow things down but that only brings the load time down to 5.5 seconds best case. I have other PHP pages on the same server that seem to execute faster. The key difference between the slow main page and the faster pages is the faster pages do not use "include" to execute code in other PHP files. However with out "include" and the modularity it affords, my PHP code would be harder to maintain. What to do?
View Replies !
MSSQL Slow On IIS 6
I built a PHP website on Windows 2000 (using IIS) that connects to a SQL Server 2000 database using the mssql functions. I migrated the website and the database onto a Windows 2003 machine, and now the mssql functions are significantly slower. On the Windows 2000 machine, the mssql_connect takes .03 seconds to run, and the odbc_connect takes the same amount of time. On Windows 2003, the mssql_connect takes a full second to run, but odbc_connect only takes .017 seconds. I have tried both ISAPI and CGI for the php configuration in IIS, and I have experimented with different values for the output_buffering parameter in php.ini, but neither of these seem to make a difference. Why would the mssql commands be so much slower on IIS 6? I would rather not have to change all the database calls to be odbc instead of mssql
View Replies !
|