Background Alternating Colour Code
Im having problem making my background alternate between colors. Following is my code, the result alternates 2 colors ok, but prints each entry from my database 30 times. Code:
View Complete Forum Thread with Replies
Related Forum Messages:
Alternating Background
<?php $i=0; while ($i < $num) { $name=mysql_result($result,$i,"name"); $type=mysql_result($result,$i,"type"); $creator=mysql_result($result,$i,"creator"); $added=mysql_result($result,$i,"added"); $description=mysql_result($result,$i,"description"); $id=mysql_result($result,$i,"id"); ?> <tr> <td>2<font face="Arial, Helvetica, sans-serif"><? echo "$id"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$name"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$type"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$creator"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$added"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><? echo "$description"; ?></font></td>
View Replies !
Background Colour Not Showing
I need to use a coloured background for a page which contains tables. Using Frontpage 2k I can create the background colour OK and it views correctly; but when viewed using apache, there is no background colour, it is just white.
View Replies !
Calender Change The Background Colour
im have made a calender that i want to tie into a sql database , and depending on the value in the database will change the background colour of that day in the calender, the problem im having is with the following: $colour = "#FF0000"; // this is just to test whether the background colour changes $cal_event_opentd = "<td align=center bgcolor=#<?php echo $colour;?><b>"; but for some reason the backgroud doesnt change,can anyone tell me where im going wrong.
View Replies !
Use Session Variables To Pass The Background Colour Of A Page
I am trying to use session variables to pass the background colour of a page loaded into a frame using session variables. I declare tyhe colour in the main page which loads first, this is the content in the main page and echos OK. $_SESSION['content_color'] = "#E9E9E9"; echo $_SESSION['content_color']; However if I echo the session variable in my loaded page in another frame I don't get anything at all.
View Replies !
How To Update Form Input Field Background Colour On Validation Error
I have been searching for form validation scripts for ages and all th ones that I like are far too complicated and inflexible so I decided to stick with my own which is easier to understand. The only thing I don't like which i have seen on better form validation scripts is that and fields with errors are highlighted. i can only presume that they have used php to set the background color of the input field or textarea. How would I add some code to change the background colour of form elements if an error is found? Here is my code which validates the form but doesn't change form elements colours. Code:
View Replies !
Row Colour
I have a table and would like the row to change colours. The table uses two colours white and green. The frist row in the table should be green then white then green then white and so on. How would i go about doing this thanks. I am using while() tio get the rows and storing it in a variable.
View Replies !
Alternating Images
i wanted to know how i cud have random alternating images on a picture profile index site eg www.mingleville.com has random profiles.
View Replies !
Alternating Row Color
Here is my rss feed display script. How do I change it to have alternating row colors?Code: <?php $xmlfile = fopen("http://www.sonicfreelance.com/rss_sonic.php?t=0", "r"); if(!$xmlfile)die("script not functioning"); $readfile = fread($xmlfile ,40000); $searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg); $filechunks = explode("<item>", $arrayreg[0]); $count = count($filechunks); for($i=1 ; $i<=$count-1 ;$i++) { ereg("<title>(.*)</title>",$filechunks[$i], $title); ereg("<link>(.*)</link>",$filechunks[$i], $links); echo "<li>"; echo "<a href ='$links[1]'>$title[1]</a>"; echo "</li>"; } ?>
View Replies !
Alternating Colors
I have a couple of problems with this example one is the variables dont work they just show as the variable name instead of the variables contents like this $Location grrrrrrrrr the other is no alternate colors.........one other person had the same problem with this example. Code:
View Replies !
CSS Alternating Row Colors
I have a query and a do while loop. I am trying to alternate row colors and think I can do it if I can pull in a number with each result returned, but am not sure what direction to head with it. Code:
View Replies !
Table Row Colour
I have a table and would like the row to change colours. The table uses two colours white and green. The frist row in the table should be green then white then green then white and so on. How would i go about doing this thanks. I am using while() tio get the rows and storing it in a variable.
View Replies !
Convert HEX Colour To Rgb
Im trying to convert a hex ref to rgb to use with the gd image manipulation. try: $rgb = chunk_split('ff0000', 2); // convert hex values to decimal $r = hexdec($rgb[0]); $g = hexdec($rgb[1]); $b = hexdec($rgb[2]); echo($r); echo($g); echo($b); gives: 15150 where id expect 25500
View Replies !
Alternating Colours For Every Other Record...
I was just looking at some site, and was wondering how they do it so its sort of like this: Record 1 - Back colour = Red Record 2 - Back colour = Blue Record 3 - Back colour = Red Im sure its not too difficult, just wondering how its done.
View Replies !
Alternating Colors In While Loop
I hope I'm not fixing to embarrass myself by asking this, because I have a feeling it is really simple, but has just eluded my brain waves. I have a table with several rows which is populated by a database in a while loop. I don't know how many rows the query will return as it is different everytime. I would simply like to alternate the background color of the table for each row. I have tried this but keep running in to some problem.
View Replies !
Alternating Email Addresses
I am trying to make my take an incoming formmail application and alternate the results to two seperate e-mail addresses? I get leads in from my website and I want a fair, and automatic way to pass them out to two people. The first one would go to email1@ and the second would go to email2@, the next would go to email1@, and the following over to email2@. If I can avoid using a database, that would be even better. I heard that I can use PHP to make this happen, but I have no idea what the code is or what the keywords are to search for the code. Does anyone know what I need to do to make this happen? I use Formmail and whatever the code is, would it happen on the html page, or the cgi script that makes it work.
View Replies !
Alternating Colors On Rows
I am making some final touches to thiis block I am working on and I am trying to get it where the rows alternate colors. For some reason though it only makes one big row and one color. Any ideas? Code:
View Replies !
Selecting Colour Problem
I have a dynamic part of the page where the user can select what colour they want the bottom and top table colour to be, the thing is, on the bottom part of the table i have my advertisment link, which if someone is cunning enough they could make the colours the same colour as the link in an attempt to hide the advertisment PHP Code:
View Replies !
Colour Top 3 Results In A Table
I'm currently trying to make a poker league whats seem to be going well. I have populated a table with the league results, but would like 1st position in gold, 2nd in silver and 3rd in bronze. These will be the first three rows of the table, as the data has already been arranged in the correct order. I'm a little unsure how to go about doing this, and wondered if anyone could point me in the right direction. Code:
View Replies !
Changing Text Colour
i had this script down but have modified it, somewhere along the way and can't see where, what i had was, if there were messages in the users inbox the word "Inbox" would go red, if there were unread messages in there the "Inbox" would go blue if there were no messages it would simple be black Code:
View Replies !
Cell Colour Change!!!
I am trying to change the colour of a cell depending on what page the user is on.. I have View.php the is loaded into every page! This is what I was trying to do but I got no clue how it goes If page is "home" Then cell colour should be blue If page is "register" Then cell colour should be Red If page is "contact us" Then cell colour should be yellow
View Replies !
Changing An Images Colour
I have an image containing 3 colours. Is there anyway using PHP i can change these colours, one at a time, to whatever colour is selected via a dropdown menu?
View Replies !
Change New Topic Colour
I just installed a mod and now when theres a new post made somewhere, when your on the mainpage instead of it just telling you who posted it and the date, it now tells you who, were and the date. Heres a preview of it: http://img210.imageshack.us/img210/6...ictitle1lm.jpg.
View Replies !
Make A Colour Transparent
I would like to do is grab an image, determine what colour is at a certain pixel (maybe 10, 10) and then set that colour to transparent for the whole image. Basically it is so that I can dynamically place an image on various backgrounds for previewing. I am not worried about perfection (anit-aliasing, matte, etc).
View Replies !
Alternating Row Colors With MySQL Results
Is there any way i could make a image for the alternating row colors instead of a strait bold color, for instance: $color1 = "#CCFFCC"; $color2 = "#BFD8BC"; Would there be anyway to link an image in there? I have tried it this way: $color1 = "<img src='..style1.jpg'>"; $color2 = "<img src='..style2.jpg'>";
View Replies !
Get Alternating Row Colors Into My Database Table
i'm trying to get Alternating Row Colors into my database table and i get this error Parse error: syntax error, unexpected T_VARIABLE in index_altrow.php on line 52 line 52 is: $table .= "<tr><td class="$class">$arr_value</td></tr>"; here is the code i am using to make the rows alter in color Code:
View Replies !
Comments Php Script Colour Change
i have just got a free php comment script of the net. but the defualt theme is black text on white back ground. Wile on my web site i have a dark back ground and white writing, so after many hours of php code readying and learning i have finaly managed to change most of the text into white exept for the last 3 text pices. 1. the "Name/ tilttle" of the comment/s 2. the "date and time" of when the comment was posted 3. the " comment/ text" which the user posted from what i have found i belive i need to set the colour in this part of the script here but everything i have tryed hasnt worked. 1. $COM_LANG['header'] = "Comments"; 2. $COM_LANG['months'] = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); 3. not sure where the code is for this :| i have just started with php.
View Replies !
Alter Font Colour Within Text Box
I have been trying to change the font colour within a text box. I have used a hidden box with echo but want to display within the box to continue the theme of my forms. I am stuck and been trying different methods, but with no joy any help would be greatly appreciated. current code this not working is PHP Code: <? echo ""; if ($percentage >= 87.5) { Â Â Â Â $color = '#00FF00' } elseif ($percentage >= 37.5) { Â Â Â Â $color = '#ff9900' } else { Â Â Â Â $color = 'red' } ?> <input type="text" name="percentage" value="<? echo '<b style="color:' . $color . '">' . $percentage . '</b>' ?>">...
View Replies !
Replacing A Colour With An Other In A Truecolor Picture
would anyone know the most efficient way to replace a colour with an other in a truecolor picture? For the moment, I'm doing it manually, looping though the pixels and using imagecolorat() to test the pixel and imagesetpixel() to change its colour if needed, but it's slooooow: a 900x800 picture takes 10 seconds or so to convert one colour, and I will need to convert up to 50 colours.
View Replies !
Colour Selected Columns Using Sessions?
i have this code that creates all these columns using checkboxes, if (isset($_SESSION['checkbox2'])) { fwrite($handle,'<td><xsl:value-of select="county_UA"/></td>'." "); } if (isset($_SESSION['checkbox3'])) { fwrite($handle,'<td><xsl:value-of select="pop_code"/></td>'." "); } <td><xsl:value-of select="county_UA"/></td> <td><xsl:value-of select="pop_code"/></td> i want be able to have the ability to give the user to colour the columns they require using dropdownlist for the fields and radiobuttons for colours: Code:
View Replies !
Alternating Row Colors On Query Generated Table?
Is there some way to make a table have alternating colors for rows when you're generating the table data with a WHILE statement? You know, row 1 has a gray BG, row 2 is white, row 3 is gray, 4 is white, etc, for as long as there's data. Here's what I'm using right now: $query_RSwho = "SELECT * FROM tbl_indv ORDER BY name ASC"; $RSwho = @mysql_query($query_RSwho, $connection) or die("Couldn't query: " .. mysql_error()); while ($row_RSwho = mysql_fetch_array($RSwho)) { if ($row_RSwho['name'] != "X") { $names .= "<tr align=left><td width=120>".$row_RSwho['name']."</td><td align=left> -- ".$row_RSwho ['email']."</td></tr>"; } } So, in that WHILE section, is there a way to alternate bgcolor table cell tags?
View Replies !
Cell Colour Based On Field Data
I have a mysql database and i am using php to display some field data in a table cell on a page. The field data is either 'failed' or 'passed', how can i make the cell colour change depending on the field data result?
View Replies !
Returning Results Of Query Into Alternating Table Cells
I am pulling results from a query into my page & am trying to get the results into a table that is 2 columns wide. I am also alternating the background color from row to row. I can get the results to alternate the background using the ternary operator, but am having trouble getting the records to echo correctly. It is obviously easy to get the records to just show a single record in each table row, but getting it to show 2 in one row & then continue on in the next row seems trickier. Code:
View Replies !
Image(jpeg) Upload & Resize Loses Colour?
I am uploading an image to a server and resizing the image then saving it to a directory,I had it working fine on my local machine (windows) but when i uploaded the code to the server (linux) - same directory structure etc, it didnt work the colour appeared to be removed from the image, as though the number of colours in the image was reduced to 2 or 4 or something? has anybody come accross similar problems with GD or image functions in php?
View Replies !
In Background
Here's my situation. I'm creating a website (basically a store) and in the admin section users will want to download zip files of images or products added in the last 7 days, last 2 weeks and the last month. I have scripted a cron to run every 24 hours to zip all the images and this process takes over 1 minute (there's over 6,000 images!!) and the size of this is 250MB. This has now taken me to my quota on my webspace of 500MB (including all the individual images) I have decided the only way to do this is dynamically create the zip when the user requests it. As PHP times out after 30 seconds it needs to do it's stuff in the background and display a message saying something like' We'll email you with the zip file in 5 minutes or so'.
View Replies !
Run In The Background?
I have a script on my website that takes a long time to run, and it's slowing down my pages. Theres nothing I can do about the wait time on the file. Is there a way to use include or fopen or anything along those lines, to have it execute my file in the background; without having the file that's executing it waiting for it to finish its thing? Or to have the expected output redirected to another file (as mentioned in http://ca3.php.net/manual/en/function.exec.php)?
View Replies !
Running Background Job...
Is it possible to get a php3 script to check what day it is, and then do some stuff, If it’s let’s say Monday? This without you doing anything. Like a background - or cronjob… I guess you would use perl or something to do this, but that is not an option I have.
View Replies !
Background Processing
What is the technique you use for background processing? Like when user submit a task, the user could then wait for the result by email or through a result page. I'm wondering how would they do that?
View Replies !
Background Color
I am totally baffled by what is happening in my code. I have a section of code (shown below with two comment lines inserted). They are essentially identical text boxes (names and variables different). Yet, the first comes up with a white background and the second comes up with a yellow/gold background....
View Replies !
Run Process In Background
I want to run process from my php script in background. I try different functions from functions list but all of them whaiting for process ending. How can I run `wget -b ...` and finish my script, but wget must still working? I use PHP5, Linux, Apache2.
View Replies !
Background Processes
I'd like to know how to send an external process to the background, so that I can run multiple instances of the same process at one time. Any tips, links.. etc?
View Replies !
|