Equal Height Columns With 1px Border
I need content boxes equal height with 1 px border, i tried this one http://www.positioniseverything.net...ple/equalheight , but i think it doesnt work standard for a 1px border, is it a good idea to measure the text with php to solve this?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Watermark Border
My site takes in a photo and currently adds a watermark to the bottom right as shown by the code at the bottom of this message. Instead i would like to take in an image like this: and turn it into a pic like this how could this be done? i guess the logical way to do it would be to create another image +40px on both height and width and then apply the original image to the centre of the new image. I would then need to get the border going around the outside in some sort of fasion. Code:
Display Data With Nice Border?
I'm using PHP since a few week. I like to know how php programmers are making so nice border to displaying MySQL table? I like to make a border with rounded corner. Could somebody tell me how can I do that?
[GD]whitte Border Aroung The Text On An Image
getting this weard error.. or what I can call it.. when Iam generating text on a image it gets whitte border.. it's no matter wich font I use (have tryed more then 20) have tryed all most all imagecolor*** variation.. but no luck...
Two Equal Strings?
I was just checking php.net but couldn't find a function that will compare to strings. Did I just overlook it? or do I have to write a function to compare the two stirngs in php? If there is a function, which one is it? If there isn't a function, could you give me an idea of the coding that would compare two strings?
When To Use 2 Equal Signs And When To Use 3
When I had these two lines in my code: if ($executed == "The command didn't exist") { $this->core->error("In CommandRenderAllActionsInAnArray we sought the command '$commandName' but ExteriorCommands could not find it. It returned the value: '$executed'.", "CommandRenderAllActionsInAnArray"); I was getting this on screen: # CommandRenderAllActionsInAnArray threw this error: In CommandRenderAllActionsInAnArray we sought the command 'checkToSeeIfThisIsTheFirstLogin' but ExteriorCommands could not find it. It returned the value: Ƈ'. But if I change the first line to this: if ($executed === "The command didn't exist") { then it works correctly. Why does this need 3 equal signs? Why doesn't 2 suffice? I've done string comparisons before and I've never had to use 3 equal signs before.
Strcmp Vs Equal
I noticed in some examples to the encrypt functions of the PHP manual a syntax was used for password checks such as if (strcmp($userpassword, md5($_POST['password'])) == 0) { // do login } What is the advantage of this compared to if ($userpassword == md5($_POST['password'])) { // do login } ?
Making Fields Equal
I have two tables in a database and I have an html form. The tables both include a field called id# and that's how I have linked the tables in my SQL statement. I would like to set up my form so that when someone enters an id# it will write the value to the id field in both tables. Does anyone have any idea how I'd go about doing this?
How Can One Variable Equal 2 Things?
I'm having a problem that is baffling me... say I set a session variable as so: $_SESSION['temp'] = "default"; Now if I test the following two conditionals: if($_SESSION['temp'] == "default") and if($_SESSION['temp'] == 0) they both return TRUE. I don't understand why this is... if anything, I would have thought testing if it == 1 would be a boolean true since the variable exists and is not NULL, but testing if == 1 returns FALSE.
Two Variables, Equal Values - ?
After seeing a script programmed by a user in the beta-test section, I copied its premise - a man vs. dragon battle, with random damage being done. It just takes random numbers each time the page loads for damage values. That's all it does. However, whenever I play it, the end HP for both man and dragon are exactly the same. I need 2 things done, or at least to know how to do them - 1) I need to know how to fix the equal-HP problem 2) I would like it if someone could tell me how to achieve the effect of a <br>...tag within a PHP script. Here's the script! Code:
Equal Ratio Image With Netpbm
I'm trying to modify a script I am running for a gallery application. The script creates thumbnails properly, but only changes it based on width, which is a variable supplied in a sql table. I'm trying to modify the script so that it so that the width "and height" are no greater than that variable. Here is what I have so far: Code: <?php function RatioResizeImg($src_file, $dest_file, $gid) { list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); $column = &$pntable['meg_categories_column']; $query = "SELECT $column[thumbwidth] from $pntable[meg_categories] WHERE gallid=$gid"; $result = $dbconn->Execute($query); list($newWidth) = $result->fields; list($newHeight) = $result->fields; switch(megConfigGetVar('imageSoftware')) { case 'GD': return RatioResizeImgGD($src_file, $dest_file, $newWidth); break; case 'ImageMagick': return RatioResizeImgImageMagick($src_file, $dest_file, $newWidth); break; case 'none': return $src_file; break; case 'browser': return 'browser' break; case 'NetPBM': return RatioResizeImgNetPBM($src_file, $dest_file, $newWidth, $newHeight); break; default: return $src_file; break; } } function RatioResizeImgNetPBM($src_file, $dest_file, $newWidth, $newHeight) { /* Define where to find the various external binaries we need */ $netpbm = megConfigGetVar('netpbmPath'); /* default: home/www/pcmodeler/netpbm */ $djpeg =$netpbm."/djpeg"; /* decompresses a jpeg to ppm */ $cjpeg =$netpbm."/cjpeg"; /* compreses a ppm to jpeg format */ $pnmscale = $netpbm."/pnmscale"; /* scales a ppm image */ $pnmscale = $netpbm."/pnmscale"; /* scales a ppm image */ $jpgtopnm = $netpbm."/jpegtopnm"; /* convert a jpg to ppm */ $giftopnm = $netpbm."/giftopnm"; /* convert a gif to ppm */ $pngtopnm = $netpbm."/pngtopnm"; /* convert a png to ppm */ $ppmtojpg = $netpbm."/ppmtojpeg"; /* convert a ppm to jpg */ $ppmtogif = $netpbm."/ppmtogif"; /* convert a ppm to gif */ $ppmquant = $netpbm."/ppmquant"; /* colour quantize a ppm */ /* $imginfo = @getimagesize($src_file); if ($galleryvar['imageSoftwarePath'] == '') $cmd = $galleryvar['imageSoftwarePath']."/"; else $cmd = ""; */ if(!file_exists($dest_file)) { if(ereg(".gif$",$src_file)) { /* Look for .gif extension */ exec("$giftopnm $src_file | $pnmscale -width $newWidth ". "| $ppmquant 256 | $ppmtogif -interlace > "$dest_file""); } elseif(ereg(".jpe?g",$src_file)) { /* Look for .jpg or .jpeg */ exec("$jpgtopnm $src_file | $pnmscale -xysize $newWidth $newHeight". "| $ppmtojpg > "$dest_file""); } elseif(ereg(".JPE?G",$src_file)) { /* Look for .JPG or .JPEG */ exec("$jpgtopnm $src_file | $pnmscale -xysize $newWidth $newHeight".". "| $ppmtojpg > "$dest_file""); } elseif(ereg(".png",$src_file)) { /* Look for .png */ exec("$pngtopnm $src_file | $pnmscale -xysize $newWidth $newHeight".| ". "| $ppmquant 256 | $pngtopnm > "$dest_file""); } else { /* not a GIF, PNG or JPG file */ return(""); } } return $dest_file; } ?> So far, I can't get it to modify the width, so that portrait images are no larger than the variable. What am I missing?
Make Function Equal To String In Conditional
I can usually figure something out, but I CANNOT figure this one out: This is a classified word ad script to count the words in a text area ($wrdad) and multiply it by the rate for how many times the ad will run in the newspaper. I know my code is messy and ameture, don't be too critical, but it works - everythign except one part. We have a 15 word minimum. I have this area commented out as //Problem Area/// in the code below. In a nutshell, I want function wordcount($wordad) to be equal to 15 if there are fewer than 15 words in the $wordad textarea. It just seems to ignore the wordcount($wordad) == 15; in my conditional. Code:
Dynimic Row Height
I am having a problem with the height of my dynamically create rows. The data is retrived properly form the database, the issue is displaying the rows. When there are alot of results to dusplay the rows are displayed correctly. If there are a few rows the hight can be 3 times the height as when there alot of rows. Code:
Image Height And Width
Is there a function to call an images height and width? For example, you have a script to upload a pic but you must resize it, so you call the images height and width and do some math on it and find out how much to reduce it by.
Getting An Images Height And Width
Is it possible in php? (to get an images height and width) I would like to do this so I can pop up a window the size of the image.... or is there another way to acomplish this, like a java function to set the window size to the image size or something?
Getting Width And Height Of Graphic?
Is it possible to get the width and height of a graphic that is being uploaded? I know it is possible to get the image size (in kb) but how would I get the dimensions?
Php Get Image Height Without The Use Of Input Box?
I'm looking around and it looks like there is lots of good info on pulling a var from php and using it in javascript, but no the other way around. All the info I can find says to just use hidden input boxes to hold the data, then post them with a submit button. But I have like 40 images, and I want to store their 'left' 'top' width' height'. Thats a lot of hidden input boxes to write (160+). It would be nice not to have those html'd into my script. Is there anyway to get the image height and set it as php data without a input box? Example: NOT THIS -----> <form method="post"> <input style="display:none" name="some image height"> <input submit> </form> document.getElementById("some image").height = $post_imageheight[]; I'm not sure if I explained this clearly enough. Let me know if you need more detail.
How To Get Image Width And Height
i am using javascript and php in my web application. before i display images, i would like to get their width and height. i used the getimagesize() function of php, but there are time when the width and height returned are blanks. i dont know how and i dont know why but there are really times like this. because of this, i started to search for a workaround when this scenario happens. i placed an onload function in my img tag. in that function i used this.width and this.height to get the size. but then, they returned zeroes. i dont know what to do now. can anybody please help me? how do i get the image width and height using either php or javascript?
How To Make Page Variable In Height
I want to programatically make my page of varying height based on the content. if you go to trinadoula.com you will see what i am talking about. you'll see the mid section of the page is a bar that could be stacked on top of itself over and over in a loop to make a variable height page. how can i use php to analyze how tall the content is (i.e. the text, or images) and then loop a image bar on top of itself to make the page different heights?
Getimagesize.. Finding Width And Height.
how can I use getimagesize(); to find the height and width of an image? I know it's a simple thing to do, but I don't quite understand the getimagesize and how to use it.. I've read the manual, but don't understand how to save the width and height as variables.
Width And Height Of A File Being Loaded
I am working on this upload script, it will upload images to my server. I want to know before I upload it into my database the width and height of the image. I am using variables like: $HTTP_POST_FILES['userfile']['size'] and I was wondering is there some built in feature that will tell me the height and width of the image?
Maximum Image Height And Width
I have a form where a user can upload a file. s there a way to check the height and width and if the the dimensions fall within a certain criteria the image is uploaded? If not uploaded I want to display and error. I would like images to be no greater than 80 pixels wide by 120 pixels tall.
How To Choose The Correct Height/width For Images
I have users that submit images to my website. By default I choose to make the width bigger than the height because usually pictures are taken horizontally... But in some cases people take pictures vertically so what I'm getting at is... can I know whether an image was taken horizontally or vertically so I can make the proper width/ height lengths so that it looks nice and not kinda weird... because if you make the width bigger than the height of an image that is supposed to have a bigger height than width, it looks kinda ugly.. And also is there a way to know when I've enlarged the image too much? because if an image submitted was small and I make it bigger, then it also becomes kind of ugly to look at because I guess there aren't enough pixels...
GetImageSize() Vs. MySQL Query For Image Height/width
Does anyone know how efficient the GetImageSize function is? We're building a MySQL database with about 20,000 images and serving it with PHP. We're expecting 3000-4000 visits (not hits) per day and there will be about 5-10 images per page view. We want to keep load time to a minimum. Would we be better off including width and height info in the database for each image (and retreive with an SQL query) rather than using GetImageSize?
PHP Notice Fixes Table-layout: Fixwed; Height: 40px;
Just would be interested, if someone has seen the same behaviour: I have a page with a table, all formatted by CSS where table.classname{ table-layout: fixed; } and td.classname{ height: 40px; } This does for some reason not work,ie. it the td gets resized, when there is too much text in it. Funnily, when I put PHP code in the page, that throws a notice, it works.
Check Date From Input Must Greater Or Equal Today Date?
I have 3 select box. Code: <select name="day"> <option value="1">1</option> <option value="2">2</option> ....... <option value="31">31</option> </select> <select name="month"> <option value="01"> Jan </option> <option value="02"> Feb </option> ..... </select> <select name="year"> <option value="2002">2002 </option> <option value="2003">2003</option> </select> When I select and click submit in form. I will have 3 variable : $day, $month and $year How can I check the day that I choose in form must equal or greater than today date? If it less than today date. I must print error message to user.
Making Gmdate Output Equal Date Output
gmdate('F j, Y, g:i a',0) returns January 1, 1970, 12:00 am. How do I add to the second parameter of the date function to make it always return that same date, regardless of the time zone? Intuitively, it seems like date('F j, Y, g:i a',0 - date('Z')) should do it, but on my system, that's an hour off. Here's some sample code: <? echo gmdate('F j, Y, g:i a',0).'<br />' echo date('F j, Y, g:i a',0 - date('Z')).'<br />' echo date('F j, Y, g:i a',0 - date('Z') + 60*60); ?> And here's the output on my system: January 1, 1970, 12:00 am December 31, 1969, 11:00 pm January 1, 1970, 12:00 am Will the last echo always return the same thing as the first echo, regardless of the time zone? If so, why? It seems that the second one is the one that should do it - not the first one.
Sortable Columns
Hi there, I am new to this Forums...I am currently learning PHP and I was wondering if any of you guys knows how to make columsn in a table sortable. What would I have to change in the code? Thanks!
UPDATE Columns With PHP
So you know I'm going through Kevins book. I'm updating data in a test table. I'm adding names to each joke, say I have 7 jokes and 3 of them go to the same person. I can update each one seperately but I can't find a way of bulk updating. In this case it's not a problem. I've looked though Kevins book and a couple of others but can't find anything. Tried several sites to but I may just be searching wrong. I can do this: mysql> UPDATE Jokes SET AID="1" WHERE ID=2; but I'd like to update WHERE ID equals 2,3,4,5 all at once.
Columns In Html
I am trying to make a table with two columns. I am really close. The problem is the table's first row has three TD's. ie one two there four five six seven PHP Code:
Sortable Columns
Does anybody know here how to make columns in a table sortable? I know that with a sql query I can accomplish that. PHP Code:
Grouping The Columns
Let's say I have a very simple Table: +---------------------+ | id | name | level | +---------------------+ | 1 | Adam | 1 | | 2 | Jack | 7 | | 3 | Bill | 1 | | 4 | Pete | 3 | | 5 | Ross | 7 | +---------------------+ but I want the PHP to output their id's and names, but group their Levels together like so: Level 1: Adam (id: 1) Bill (id: 3) Level 3: Pete (id: 4) Level 7: Jack (id: 2) Ross (id: 5) And then afterwards, If I create someone with a new level, PHP will automatically create a new heading (e.g. Level 10) and put the corresponding names under it. How should I approach this? Should my PHP contain two "while"s? Or do I use the SQL <group by> function?
Displaying Columns With A Value
what is the most efficient way to display column names from a database that only have the value '1' in its fields?? I cant seem to work it out, could someone give me a code example??
Creating Columns
I've been using this code to split records from a db into columns when it displays the data. Items are shown with 3 on a row and then a new row starts. It works really well but if ever there is only one item on a row it causes me a problem in this instance. I have far left and far right columns which display a background image, which is a border. The problem is this only works if there are three columns visible in a row. Is it possible to manipulate the following code so that there are always three columns present, they're just empty if there's no more records to fill them? Code:
In Email Form How Do We Say "must Be Equal To X"?
we are getting a lot of spam through our PHP Feedback form, and have set up a new field 'prove you're human', asking them to do some simple maths. What is the command for the PHP script itself, to say "this field must be equal to 9 or return the error page"?
Count The Number Of Columns
I was wondering if there is a way to calculate the total of columns in a table? (something like $totalRows= mysql_num_rows($Recordset1); , but than for columns)
Best Practices For Sortable Columns
I have several forms that display information from the database after users log in. I would like the column titles to be sortable so that when the user clicks on a column heading, the data re-displays in sorted order of that column. Next time they click on it, it toggles the order from ascending to descending, and then back to ascending again. Since I have many forms and each form has different columns, I was wondering if there was a method that would be better than a brute force approach. What are the best practices for this functionality?
Query Results In 2 Columns?
I'm struggling to figure out how to do this properly. I have done a mySQL query to extract a list of names, and done a mysql_num_rows to determine how many results I've gotten. I want to split the list in to two columns. I've created $percol = $mysql_num_rows/2 but I'm not quite sure how to "loop" through the first half of the list, echo </td><td> and then list the balance. Can anyone give me some guidance on how best to structure this?
Index On A Combination Of 2 Columns ?
on a Mysql table i have 2 columns: - banner views - banner clicks now i want an index on the MySQL table so that i can make an overview with the order set to bannerclicks/bannerviews so i need an index on (bannerclicks / bannerviews ) is there a way to do this in MySQL without the need of an extra column ?
|