User Profile
Collapse
-
One more question relating to this topic. Are there any good starter tutorials for the php GD library? I've found some...php.net has the manual, but I'm looking for a starting point that gets me into it quickly, and then I can spend more time looking at all the details. -
Thanks. I've got a Mac for development, and running ubuntu for our server.
The answer I found was php GD library, and was also able to find a great walkthrough for the install.
http://www.libgd.org/DOC_INSTALL_OSX
obviously applies only to OSX, but its helpful in case anyone in my situation runs across this. The only thing - before you follow the instructions make the following directories:
/usr/local/man...Leave a comment:
-
PHP library for printing landscape
I seem to remember from somewhere that there is a PHP library for converting a php page into an image, and rotating it for printing in landscape. I haven't been able to find anything on google, or bytes. A lot of chatter about the @page CSS properties (which don't work). Not what I need though...
A point in the right direction would be appreciated. -
Solution Found
The solution is actually pretty simple (kicking myself).
Since I am using images, I am placing a div around each image that needs to be displayed to create the form. The div is positioned using position: relative. So, both the image AND the information are placed within the div. Then, the absolute positioned information is adjusted based on the div it is now contained in, and prints as well.
...Leave a comment:
-
More testing and interesting results for printing absolute positioned element
Alright, so it gets more interesting.
I've been trying to get the printing to work, and tried setting up the absolute positioned element within a relative positioned element (since an absolute positioned element is based on its most recent ancestor with positioning applied)
Here was my first test:
...Code:<html>
Leave a comment:
-
Absolute positioned HTML elements not printing
I am having an issue with HTML elements not printing when positioned absolutely when they extend beyond the first page. I am working on some foreign tax refund forms. The forms are cut into multiple jpg images, so that I can position them on the HTML page, so that they print properly (page1, page2, etc). The information to complete the forms is then positioned using position: absolute and a z-index of +1.
Here is an example code of... -
My biggest issue with size was a series of drop down boxes, that could contain very large lists. I found the solution to be to not inlcude the drop down boxes in the save. I haven't had any issues since then.Leave a comment:
-
The problem with firefox is in your function a_state, you are using:
To get the actual value of the textarea, use value.Code:p.innerHTML = this.innerHTML
Again, this works in Firefox. I don't have IE, and I have yet to test in Safari. Will get back to you with Safari (and maybe Camino?) if I can find out anything elseCode:p.innerHTML = this.value;
Leave a comment:
-
Thanks for the information. I had tried using date('u') initially, but that only returned all 0's.Leave a comment:
-
-
Curiosity is something that plagues me. In our discussion, you mentioned a site you were working on. What site is it? -
Here's the code that I speed tested:
...Code:function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); $i = 0; while($i < 1000){ $info = mysql_query("SELECT email, email_privacy FROM testtable2 WHERE id = '1'"); while($row = mysql_fetch_array($info)){Leave a comment:
-
Leave a comment:
-
Found the anser at php manual.
Here is the code for testing time in microseconds:
[code=php]
<?php
/**
* Simple function to replicate PHP 5 behaviour
*/
function microtime_float ()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float ();
// Sleep for a while
...Leave a comment:
-
-
Speed Test PHP Script
I was thinking about how to speed test a php script, and I'm not sure.
I get the basics:
testing the first action
testing the second actionCode:$i = 0; while($i < 10000){ //do action 1 } //return time
...Code:$i = 0; while($i < 10000){ //do action 2 } //return timeLeave a comment:
-
Not sure if its the best. I don't know how to test script speeds, but thats how I would think of doing it...(note the "newbie" under Chemlight :-) )Leave a comment:
-
I like the idea of metadata. You could pre-pend the metadata with the public/private value, use whatever delimeter, and then split the value with your script, limiting it to only one split.
so, for example, email would look like
private;myemail @email.com
then, when you queried the table, you would run something like this (I'm using php as an example, not sure what script you're using)
...Code:$email = mysql_query("SELECTLeave a comment:
-
chemlight replied to Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result sourcein PHPThat worked. I was also just about to post that testing if the resource is null also works.
One of the things I had tried was:
But that returns 1 in both cases. The mysql_num_rows returns the proper count.Code:if(count(mysql_fetch_array($result)) > 0)
Thanks again for your help and patience!Leave a comment:
-
chemlight replied to Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result sourcein PHPI also decided to test it by providing a variable to the query string istead. I got the same results
...Code:<?php require("scripts/db_connect.php"); $vendor = 4486; $result = mysql_query("SELECT * FROM vendor_details WHERE id = " . $vendor . ""); if(!$result){ echo "no vendor " . $vendor . "<br />"; }else{ echo "vendorLeave a comment:
No activity results to display
Show More
Leave a comment: