Need some feedback please on a project

Discuss all aspects of programming here.

Moderator: The Mod Squad

Postby MoboCop » Thu Jul 14, 2005 9:18 am

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
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno

Postby Toby B. » Thu Jul 14, 2005 5:15 pm

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: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby Toby B. » Thu Jul 14, 2005 10:27 pm

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... :?
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby MoboCop » Fri Jul 15, 2005 8:53 am

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
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno

Postby Toby B. » Mon Jul 18, 2005 1:40 pm

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)
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby MoboCop » Mon Jul 18, 2005 1:55 pm

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
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno

Postby Toby B. » Mon Jul 18, 2005 4:38 pm

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...
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby MoboCop » Tue Jul 19, 2005 7:57 am

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
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno

Postby ~Rob » Wed Oct 12, 2005 2:27 pm

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
Image
Jocuri cu impuscaturi si alte genuri, pentru toate varstele doar pe acest link - distractie si amuzament garantat!
~Rob
Black Belt 4th Degree
Black Belt 4th Degree
 
Posts: 4941
Joined: Sun Dec 28, 2003 8:26 pm
Location: Norwich, UK

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests