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 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 !
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 Replies !
Slow Site
My site starts loading very slow. At first I thought that this is host problem, but now I have moved to another host, which should be much faster. Then I start thinking that I have problem in my code. So I start measuring time at the very first header and at the bottom of the page (footer). PHP Code: $today = date("H:i:s"); The difference between header and footer was only 5 secunds. So I figure it out that you have to wait over 20 secunds just to start loading PHP code. Please I could use any tip to improve speed.I'm using PHP and SQL.
View Replies !
Site Loading Slow
I see the site loading very slow. and some times i get an error saying " connection timed out". Is there any free third party tool available to check the page loading time and which will email me.
View Replies !
PHP Driven Site Responding Slow On Different Networks.
I have a strange bandwidth issue that I have finally tracked down to something fairly specific if anyone has any ideas... Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI Network: DSL line with a Cisco 678 router using NAT and static port maps. Two switches between webserver and Cisco. Problem: Accessing PHP driven site via any computer except the web server is about 20 times slower. I can get fast response on the server by browsing to it's local IP address (http://10.0.0.x) or (http://localhost). However, if I use the external IP address (65.100.86.X) from the IIS server, the site is slow again. I figured that my Cisco had an issue or there was some problem in my network, so I replaced my Cisco with my spare and swapped out hubs for switches etc internally with no change. If I use a different computer on my LAN to go to http://10.0.0.X then I get the same slow response. I have packet dumped my network (nothing strange) and even disconnected all computers except for the IIS server and I still get the same results. I really thought it was a network issue until I replaced everything. If I telnet to one of the slow IP addresses, the HTML just comes out slower. I still think this is a network issue but I just wanted to post here in case there was something strange with PHP under 2k3 that I was missing.
View Replies !
Can't Copy() Stream From Https Site
I'm trying to copy a stream from mobical.net to a local file (for those of you who don't know, Mobical is a free online SyncML server, but they don't officially offer iCalendar support). Unofficially, you can go to: https://www.mobical.net/mobical/ics and enter your Mobical username and password (HTTP authentication). It then begins a download of your current calendar etc. as an iCalendar stream. I tried: -------------------------------------------------------- <?php if (!copy('https://user:pass@www.mobical.net/mobical/ics', 'test.ics')) { print ("failed to copy file...<br> "); } ?> -------------------------------------------------------- but I get the following output: -------------------------------------------------------- Warning: copy(): HTTP request failed! HTTP/1.1 401 Unauthorized in /var/www/testcopy.php on line 3 Warning: copy(https://...@www.mobical.net/mobical/ics): failed to open stream: Success in /var/www/testcopy.php on line 3 failed to copy file... -------------------------------------------------------- If I try to copy a static HTML page from an HTTP server it works fine, but not with the HTTPS stream. Someone here: http://www.hipcal.com/forum/viewtopic.php?pid=1180 mentions that if they attempt to download the file with WGET it redirects once. Could that be part of the problem?
View Replies !
How Can My Program Link To An Https Site?
I'm trying to find out how I can log on and interact with an https website. I've worked out so far that my program will be acting pretty much like a browser i.e. I don't need to install any special software like OpenSSL as that is for the server side of things. However, I don't know how a browser does the secure bit, so can anyone enlighten me as to how I can do this with my program? Does PHP have any built-in commands to help with this sort of thing?
View Replies !
CURL Installation Cannot Access Https Site
I am experiencing problems trying to make my curl works. For all other sites, i could able to execute request successfully. However for https site, i received an error vias "curl_error()" method: "Cannot connect to host". I have compiled curl --with-ssl=/usr/local/ssl and PHP with --with-curl=/usr/local --with-openssl=/usr/local/ssl
View Replies !
SSL When To Redirect A User To The Secured (https) Side Of A Site
Does anybody have a suggestion on when to redirect a user to the secured (https) side of a site? My specific scenario is, I want to offer users a"value added" area which requires a username/password. The real question here is should the page which prompts them for credentials be secure, or the page the logon redirects them to?
View Replies !
HTTPs - Block HTTP And Allow HTTPS
I have a PHP program that runs on Apache and connects to MySQL. The network administrator told me that they will block HTTP and allow HTTPS, will that cause a problem with my application? The administrator will install the certificates, do I need to change the code? The database is hosted on the same server too.
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 !
Transferring Sizes
PHP Code: if(!isset($HTTP_SESSION_VARS['cart'])){ Â Â Â Â $HTTP_SESSION_VARS['cart']=array(); Â Â Â Â $HTTP_SESSION_VARS['items']=0; Â Â Â Â $HTTP_SESSION_VARS['total']="0.00"; } if($add){ Â Â Â Â $itemID = $HTTP_POST_VARS['product']; Â Â Â Â $isFound = false; Â Â Â Â for($i =0; $i< count($HTTP_SESSION_VARS['cart']);Â Â $i++){ Â Â Â Â Â Â Â Â if($HTTP_SESSION_VARS['cart'][$i]['Item_ID'] == $itemID){ Â Â Â Â Â Â Â Â Â Â Â Â $isFound = $i; Â Â Â Â Â Â Â Â Â Â Â Â break; Â Â Â Â Â Â Â Â } Â Â Â Â }.....
View Replies !
Transferring This Short .asp-script To Php....
I got this script form a customer. in general, it recieves data which is send via http to a server and generates a .xml file from this data. because i'm not familar with .asp, i'm totally lost transferring this script to php. i don't understand which way the data is recieved and how it's saved. as long this ia a very short script, i post it here. it would bne GREAT if someone could give me some tipps on how to migrate this whole thing to PHP and how it recieves the data via http.
View Replies !
Automatically Transferring A File
I've been looking all around the internets for a solution to a little problem I'm having with my latest php based website, which just happens to be two other things too - my university dissertation, and a major pain in the head. The problem is, once one script has uploaded, processed, and saved information to a database, the file needs to be moved to another server (one is fast at processing, the other has 2Tb free space) for the indefinite hosting. I can't seem to do this with PHP's FTP functions and I'm assuming this is because of the limitations of PHP's file handling ability. Is there a possiblity to do this using exec() and Fedora's built in FTP programme, or something similar? The filesizes can vary from around 10mb to maybe 300mb. Both servers are on fibre links so speed isn't a problem. I'd thought FTP through exec might work, but can't figure out if FC4 can accept a complete FTP function in one go. If it helps, I've got root access to the main server where the scripts are hosted.
View Replies !
FTP: Transferring Entire Directories
I'm trying to work out a script that will help me backup my website to another web server. The idea is to use PHP's FTP capabilities to transfer directories from one server to another. This allows me to get my slow DSL connection out of the backup picture, which will also vastly facilitate moving my site to another server if I should ever need to do that. Anyway, I know how to transfer individual files using PHP FTP, but I don't know how to transfer whole directories. I've looked around the PHP documentation but haven't found anything that seemed to address this problem. In an ideal world I could just make a .tar.gz file of my site and transfer that; however, I don't have enough server space to do that and I'd rather have easier access to the backed up files anyway. So, is there any way to use PHP's FTP capabilities to transfer directories from one server directly to another? And, if there is, will the file/directory permissions be maintained?
View Replies !
Transferring Csv Files To Mysql Db
I'm using php with mysql. I am trying to transfer a csv file from my home computer into a mysql database on a remote server. I'm basically trying to transfer a file with a list of ip addresses to help me block scammers from other countries like Nigeria and Ghana. I am quite sure that the path of the file on my computer is correct, but I still get the same error message. If someone could just show me where I am going wrong it would be greatly appreciated. Here is the error message I am getting along with the coding that I believe is correct. ERROR 2 (HY000): File 'C:/country/ip-to-country.csv' not found (Errcode: 2) LOAD DATA LOCAL INFILE "C:/country/ip-to-country.csv" INTO TABLE `country_list` FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '' LINES TERMINATED BY ' '
View Replies !
Transferring Data Through The Same Page
I want the user to fill in the form and click preview with all the information sent to the ?mode=preview part, and let them preview their content, and then click upload with all the data from ?mode=upload. Page 1 (?mode=upload): Title: Swf: comment: Page 2 (?mode=preview): validate form Get all the data from ?mode=upload show a preview of the swf and put the data in the database.
View Replies !
Transferring Value Into A Varibale In Text File
I have a text file which looks like this: Quote: Your unique profile identifies that $tRel % of your time investment during this capture period has been placed in the Partner / Confidant plane. This level of investment is very high and will have both positive and negative outcomes. I extract the contents of the file through the following code: PHP Code:
View Replies !
Transferring Variable / Hiding Php-file
I would like to do this html/file1.php cgi-bin/file2.php it is called: file1.php$c1=something file1.php is: <? include "/cgi-bin/file2.php?c1=$c1" ?> But it gives: Warning: main(/cgi-bin/file2.php?c1=1234): failed to open stream: No such file or directory Seems its looking for file "/cgi-bin/file2.php?c1=1234", instead of calling file /cgi-bin/file2.php with variable c1=1234 What am I doing wrong? What I'm trying to do, at the moment there is just one .php file, html/file1.php which includes sql-password. So instead of file1.php (with sql-password) being in /html I would like file1 just call file2.php in cgi-bin, so if there is some problem with php, people would only see <? include "/cgi-bin/file2.php?c1=$c1" ?> instead of sql-password. And file2.php including password would be in protected directory, not visible to net. Am I trying the right thing? Im not sure if file1.php should run include, exec, or something else? The real code (that im trying to move to file2.php) uses echo:s to make a html-page Does it work like that, or do i need to use some return, to return the page from file2 to file1, and only file1 to echo it?
View Replies !
Transferring Web Hosts - Php/mysql Application
I have an application that is written in php/mysql on a Linux platform and need to transfer hosts. This is a session based application and I don't know a lot about php/Linux/mysql, but can get by. I know windows/asp, etc. much more extensively. So, can I just move the whole thing over to a Windows server, upload the mysql backup database and change the settings for the db connection and have it work? Is there anything that would prevent this from transitioning smoothly? If so, if I stayed with a Linux platform, would the transition be this easy or would I have coding changes with this as well. I need to tell the new host which platform today and I would rather use windows, but if there are going to be too many coding changes on Windows, then I'll leave it on Linux, but if there is just as much work on Linux, then I prefer to stick with Windows.
View Replies !
Transferring Session ID Accross Hosts
What i'm looking to do is have the same session on 2 different hosts. For example: http://www.website.com/ and https://securesite.com/website/ Now i know this is easy by passing PHPSESSID via a get string, with a bit of php.ini tweeking, it does mean that there is a security risk associated with doing this (being able to hijack sessions). What I was hoping to do was specify a setCookie("PHPSESSID", $SID, '/', 'securesite.com'); however it seems to not work either. If anyone knows an easy way of doing this i would be very interested in learning how to do this.
View Replies !
Transferring Variables Between Seperate Hosts
can you tranfer variables stored in a PHP page on one server to a page on a different server via a form POST and be able to access those variables on the new page using Perl? From my understanding of HTTP I can't see why this should be a problem but it does not seem to work at the moment although I am sure it is not a scripting error at this stage...
View Replies !
Transferring The POST Content From One Page To Another
Is there an easy way to transfer a page POST content to the next page? Right now I read out the POST content in the PHP script and put it in a html form (with POST as content type) as a hidden field, but I am wondering if there isn't a nicer solution to do this. I need this functionality so that the user is able to re-login if for some reason his/her session got lost. This happens every now and then when the user is completing a form and hence the need for re-submitting the form data after logging in again. The form also contains arrays, so I have to iterate through all of them which is okay.
View Replies !
Transferring Data To Another Page After A Form Process
Quick question: Is it possible to copy some results from a form (via POST) to another page after submitting the form? I'd like to use the results somewhere else later on, but want the form to process normally without the user being forced to redirect to the other page. I've got a vague idea, but I don't know if such a thing would indeed be possible in php or not.
View Replies !
Transferring The Selected Record From The List Box To Textbox
Breifly, I've 3 list boxes.Select a record from the first one, click a button, the second list box is filled and select a record now and then click a button, the third list box is filled.Now, select the record, the selected record has to be shown in the text box.But, I also want to show one more field related to this one in another text box.How can i do?? well, the first list box shows the topic names, 2nd one the sub-topic names and the third one the article names. Now, when i select the article name, the article name and the article content has to be shown in the text boxes. If its just article name, i know how to do it by java-script but i also need article content to be shown. Could somebody please help me how should i modify my code and where should i insert the text boxes?? Also, one more question, If i make any changes to the data in the text boxes, i would like to update.How can i do that?? PHP Code:
View Replies !
Transferring Data From A Form To PHP With A Standard Script
I'm pretty new to PHP/forms...and I've got a pretty dumb problem (i.e. there is probably an easy solution). Well, I'm unsure of how to describe the problem, so I'll just give an example. Checkbox: Red Checkbox: Blue Checkbox: Yellow How would I get that information in to PHP (query) without knowing in advance what the names on the checkboxes were? The only solution my programming-retarded brain can come up with is running a loop to try every possible name that the checkbox could have...which, I'm sure, is a great idea *laughs* If my question doesn't make sense, I apologize. I did my best, but I'll give it another shot if it's confusing.
View Replies !
Transferring A MySQL Database From Local PC Onto An ISP Server
If I have an MySQL database on my local w2k, how do I transfer it onto my ISP server? The ISP gave me the name of an empty MySQL database they set up for me, the username and the password with no further explanations. I came here from ASP/Access where I was just uploading a mdb file into my webspace. But with MySQL there should be a different procedure,
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 !
Is_null Very Slow
I recently loaded a binary copy (5.0.3) onto my PC running win2k and Apache 2.0.52. It seems to work fine except that it is very slow running the function is_null e.g. the dummy program below - <?php for($i=0; $i<1000; $i++) { if(is_null($x)) $y=0; } echo 'done' ?>
View Replies !
Website Too Slow
I'm re-programming my Website (www.coaster.ch) in PHP and I find it too slow (although I have ADSL). That's more or less how it functions: Here my tables: 'COASTERS' (code of coaster, code of country, etc...) 'COUNTRIES' (code of country, names of countries in different languages, code of continent) 'CONTINENTS' (code of continent, names of continents in different languages) In my index.php (start site) I use a "while": I look for the first continent. I look for the first country I count all the coasters from 1st country echo country - number of coasters I look for the second country I count all the coasters from 2nd country .... .... I look for last continent.... The search and presentation in tables (I use 5 tables, 1 for each continent) is rapid. The problem is when I go the the sub-site of a country and want to come back to the index site: it takes too much time. Could it be that it is slow because it has to make the whole search again? Can I solve that by making the first search (at the begin of the session with something like requireOnce "search data) and charge all the information in an array and them when returning from a sub site only showing the array? I also thought that perhaps the reason could be that I use tables for continents and countries but otherwise I should have to include all these texts in .inc files...
View Replies !
Fread Is Slow, Is There A Better Way?
I have been trying to stream a 19mb quicktime file through PHP. While this script does work i find it to be really slow. Is there any way i can make it faster? I have tried using fpassthru and using a smaller buffer and neither seemed to have much effect. Code:
View Replies !
Slow Mail()
I have a script with a mail() command to send an email to myself to inform user's ip and referrer. I've been using it without any problems for the last three years. Big changes I had to make in many scripts when I turned register_globals off. After this, access to that page (script) is very slow (1-2 minutes) unless I comment mail() out. I cannot figure out what should I set to fix it ....
View Replies !
Apache2 W2K Slow
I do PHP programming on a Windows 98 computer, (why 98 - well I want to run VBDOS on this computer). I then transfer PHP files to a W2K computer. I recently moved to Apache2 and PHP 4.3.11 (from 4.1.3). One page in particular has some fairly intensive work to do, accessing MySQL a lot and creating two large tables. This page takes 2 1/2 times longer to load on the W2K server than the W98 server. I have done timings for various parts of the page using mictotime. All parts are slower on W2K. Both servers are using the same PHP.INI file. Globals has to be on as some of the programs still need it, not yet converted. Anyone has similar experience?
View Replies !
|