The Mother Board

Motherboards.org forums. Free tech support, motherboard ID, and more.
It is currently Wed Dec 12, 2018 4:33 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Ctechinfo's coding log
PostPosted: Thu Oct 20, 2011 6:36 am 
Offline
Lead Mobo-fu Master
Lead Mobo-fu Master

Joined: Sun Dec 16, 2001 1:01 am
Posts: 14303
Location: Maine
In the ever annoying attempt to clean up old code (on my site) and make things more efficient I am starting this thread so I can ask for assistance and get input on the project as a whole, and have it confined to one spot..

_________________
Compaq-Fu Master
Ctechinfo funding drive information


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2011 7:39 am 
Offline
Lead Mobo-fu Master
Lead Mobo-fu Master

Joined: Sun Dec 16, 2001 1:01 am
Posts: 14303
Location: Maine
10 hours tweaking code to produce 3 lines on a webpage..

_________________
Compaq-Fu Master
Ctechinfo funding drive information


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2011 7:49 am 
Offline
Mobo-fu Master
Mobo-fu Master

Joined: Thu Dec 04, 2008 8:25 pm
Posts: 3147
Location: Right behind you
Don't you hate that? Gimme a few months, I'm finishing up a website development class in college, maybe I can help a bit.

_________________
Faster than the speed of snot

Two wrongs don't make it right, but I sleep pretty good at night


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 20, 2011 10:14 am 
Offline
Lead Mobo-fu Master
Lead Mobo-fu Master

Joined: Sun Dec 16, 2001 1:01 am
Posts: 14303
Location: Maine
fussnfeathers wrote:
Don't you hate that? Gimme a few months, I'm finishing up a website development class in college, maybe I can help a bit.


yes its a pissah!! lol

_________________
Compaq-Fu Master
Ctechinfo funding drive information


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 21, 2011 4:02 pm 
Offline
Lead Mobo-fu Master
Lead Mobo-fu Master

Joined: Sun Dec 16, 2001 1:01 am
Posts: 14303
Location: Maine
The code that I work on for hours seemed to work but is buggy now.

Code:
<p align="left">
<b>Found in the following systems:</b><br><?php
if (isset($modelscompaq, $modelsboth)) {
echo '<font color="#ff000"><b>Compaq</b> - <i>'.($modelscompaq).'</i></font><br><b>Compaq/HP</b> - <i>'.$modelsboth.'</i>';}
if (isset($modelsboth, $modelshp)) {
echo '<b>Compaq/HP</b> - <i>'.($modelsboth).'</i><br><font color="#0000ff"><b>HP</b> - <i>'.($modelshp).'</i></font>';}
elseif (isset($modelscompaq, $modelshp)) {
echo '<font color="#ff000"><b>Compaq</b> - <i>'.($modelscompaq).'</i></font><br><font color="#0000ff"><b>HP</b> - <i>'.($modelshp).'</i></font>';}
elseif (isset($modelsboth)) {
echo '<b>Compaq/HP</b> - <i>'.($modelsboth).'</i>';}
elseif (isset($modelscompaq)) {
echo '<font color="#ff0000"><b>Compaq</b> - <i>'.($modelscompaq).'</i></font>';}
elseif (isset($modelshp)) {
echo '<font color="#0000ff"><b>HP</b> - <i>'.($modelshp).'</i></font>';}
else {
echo "Information not availible";}?></p>


Essentailly I want the code to work in such a fashion that if two variables exist it will produce the the code for both like so:

Compaq - Models found in
HP - Models found in

OR

Compaq - Models found in
Compaq/HP - Models found in

OR

Compaq/HP - Models found in
HP - Models found in


And if only one variable exists the code would produce the corresponding line. but what is happening with the current code is it is doubling up the line that is in the two line block and single line block like

Compaq - Models found in
Compaq/HP - Models found inCompaq - Models found in

_________________
Compaq-Fu Master
Ctechinfo funding drive information


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group