Raised This Month: $51 Target: $400
 12% 

PHP Help needed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-26-2011 , 15:23   PHP Help needed
Reply With Quote #1

Hey, how can I add bold if parameter $i+1 is less than 4...

I've tried

PHP Code:
<tr>
<?php if($i+4) echo "<b>"?>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $i+1?></font></td>
<td><img src="<?php echo "flags/$country.png"?>"></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5?></font></td>
<?php if($i+4) echo "</b>"?>
</tr>
It doesn't work :/
reinert is offline
8088
Veteran Member
Join Date: Jan 2008
Old 01-26-2011 , 15:42   Re: PHP Help needed
Reply With Quote #2

This has nothing to do with PHP. You can't just add <b> at random places and expect it to have its desired effect. By using a validator this would be easy to spot.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-26-2011 , 16:08   Re: PHP Help needed
Reply With Quote #3

Oh yeah thanks for link, I've successfully checked it without doing a bold or smth not important ;D

Well How could I make that if the $i+1 is 1, then it will print $i+1 in red ?

I've tried :
PHP Code:
<td><font face="Arial, Helvetica, sans-serif"><?php $a $i+if($a == 1) echo "<font color="FF0000">$i+1</font>; else echo $i+1 ?></font></td>
It gives me syntax error.

Also two more questions,

first: how could I switch text from uppercase to lowercase ?
Second: How could I make such table like:



Attached Thumbnails
Click image for larger version

Name:	photo.png
Views:	432
Size:	9.0 KB
ID:	81214  

Last edited by reinert; 01-26-2011 at 16:25.
reinert is offline
8088
Veteran Member
Join Date: Jan 2008
Old 01-26-2011 , 17:09   Re: PHP Help needed
Reply With Quote #4

Quote:
Originally Posted by reinert View Post
I've tried :
PHP Code:
<td><font face="Arial, Helvetica, sans-serif"><?php $a $i+if($a == 1) echo "<font color="FF0000">$i+1</font>; else echo $i+1 ?></font></td>
You shouldn't use deprecated tags like <font>. Use CSS instead. Just a suggestion:
Code:
.red {
font-family: Arial, Helvetica, sans-serif;
color: #ff0000;
}
PHP Code:
if($var==1$class="red"
HTML Code:
<td class="<?php echo $class ?>"><?php echo $var ?></td>
Quote:
It gives me syntax error.
The key is to read and understand errors.
Quote:
first: how could I switch text from uppercase to lowercase ?
First: why haven't you searched before asking here? Here's a hint: strtoupper.
Quote:
Second: How could I make such table like:



By reading about and understanding how table, thead, tfoot, tr, and td tags and their attributes like colspan and rowspan work.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-26-2011 , 17:12   Re: PHP Help needed
Reply With Quote #5

This website is really great for references as well as learning.
http://www.w3schools.com/default.asp
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 01-26-2011 , 19:09   Re: PHP Help needed
Reply With Quote #6

If you're using tables...make another table in the data column with one row and three columns.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
8088
Veteran Member
Join Date: Jan 2008
Old 01-26-2011 , 19:32   Re: PHP Help needed
Reply With Quote #7

I think setting colspan="3" on the second cell in the first row is a lot easier.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-26-2011 , 19:50   Re: PHP Help needed
Reply With Quote #8

Quote:
Originally Posted by 8088 View Post
I think setting colspan="3" on the second cell in the first row is a lot easier.
I was going to say that but I thought he should learn on his own.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode