Need some feedback please on a project

Discuss all aspects of programming here.

Moderator: The Mod Squad

MoboCop
Drunken Master
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno
Contact:

Post by MoboCop »

Toby B. wrote::mb_bangdesk::

Code: Select all

$rlink = 'http://www.intel.com/design/motherbd/oem/index.html'
I really need to learn to pace myself... :roll:

Code: Select all

<?php
if ($retail == None) { 
   echo "There is no retail information availible."; 
} else if ($rlink != None) { 
   echo "<a href='".htmlentities($rlink)."'>$rlink</a>"; 
   } 
if ($rlink2 != None)
   echo "<a href='".htmlentities($rlink2)."'>$rlink2_descript</a>";
?>
Havent tried to use 2 links at a time with the updated code, but I got the single links figured out... :oops:
Have a question. What is None? Why do you use it?
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
Posts: 14303
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine
Contact:

Post by Toby B. »

Have a question. What is None? Why do you use it?
Too newb to PHP to figure out the correct way... :P
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
Posts: 14303
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine
Contact:

Post by Toby B. »

Well I made a bit of progress. I am replacing "None" with False or True in the else if statements. Working pretty good so far.

The one issue that I am noticing with the code it the in the parsed links (i.e. the URLs that show on the HTML pages), the double quotes wont show like

Code: Select all

<a href="test_page.html">Test link decription</a>
It eith shows up as:

Code: Select all

<a href=test_page.html>Test link decription</a>
or:

Code: Select all

<a href='test_page.html'>Test link decription</a>
Either way the links are funtional. Just looks strange when viewing the source... :?
MoboCop
Drunken Master
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno
Contact:

Post by MoboCop »

Toby B. wrote:Well I made a bit of progress. I am replacing "None" with False or True in the else if statements. Working pretty good so far.

The one issue that I am noticing with the code it the in the parsed links (i.e. the URLs that show on the HTML pages), the double quotes wont show like

Code: Select all

<a href="test_page.html">Test link decription</a>
It eith shows up as:

Code: Select all

<a href=test_page.html>Test link decription</a>
or:

Code: Select all

<a href='test_page.html'>Test link decription</a>
Either way the links are funtional. Just looks strange when viewing the source... :?
If these are parsed then you need to do this

Code: Select all

'<a href="test_page.html">Test link decription</a>'
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
Posts: 14303
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine
Contact:

Post by Toby B. »

well hereis what I was able to accomplish:

Code: Select all

$b_docs = '"http://www.fica.com/site/html/services/faq_detail.asp?c_id=240000477"';
$bdocs_descript = "Jumper Settings";

Code: Select all

<?php 
if ($b_docs == false) { 
   echo "None"; 
} else if ($b_docs == true) { 
   echo '<a href='."$b_docs".'>'.$bdocs_descript.'</a>'; 
   } 
?>
Setting up the HREF's like this works perfectly.. 8)
MoboCop
Drunken Master
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno
Contact:

Post by MoboCop »

Toby B. wrote:well hereis what I was able to accomplish:

Code: Select all

$b_docs = '"http://www.fica.com/site/html/services/faq_detail.asp?c_id=240000477"';
$bdocs_descript = "Jumper Settings";

Code: Select all

<?php 
if ($b_docs == false) { 
   echo "None"; 
} else if ($b_docs == true) { 
   echo '<a href='."$b_docs".'>'.$bdocs_descript.'</a>'; 
   } 
?>
Setting up the HREF's like this works perfectly.. 8)
Great.
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
Posts: 14303
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine
Contact:

Post by Toby B. »

Thanks for the help/advice Patrick... :wink:

I know I am a little ahead of myself in the whole coding area.. But I am learning more and more each day.. Even if I have look like a complete dumbass and/or go round and round cause I am too vague on what I am trying to do...
MoboCop
Drunken Master
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno
Contact:

Post by MoboCop »

Toby B. wrote:Thanks for the help/advice Patrick... :wink:

I know I am a little ahead of myself in the whole coding area.. But I am learning more and more each day.. Even if I have look like a complete dumbass and/or go round and round cause I am too vague on what I am trying to do...
Just keep plugging away. No one thinks you are a dumbass.
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
~Rob
Black Belt 4th Degree
Black Belt 4th Degree
Posts: 4941
Joined: Sun Dec 28, 2003 8:26 pm
Location: Norwich, UK
Contact:

Post by ~Rob »

I know you are using php, but I'm a java guy so can you use line thingies like

Code: Select all

public void example() //This line declares something
[img]http://i3.photobucket.com/albums/y83/RobPope/sigmove.gif[/img]
[b]Jocuri cu impuscaturi[/b] si alte genuri, pentru toate varstele doar pe [url=http://smarturl.it/jocuri]acest link[/url] - distractie si amuzament garantat!
Post Reply