Web link and PHP

How to pass an attribute of a web link to a PHP script.

Page 1 of 1

3 Replies - 776 Views - Last Post: 31 May 2010 - 05:40 AM Rate Topic: -----

#1 sheraush  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-January 10

Web link and PHP

Posted 30 May 2010 - 04:34 PM

Hi All,

I need help with something here. I have a PHP script to show certain fields from a database, how it works is there are a bunch of links on this page, and each link would show different set of links and eventually info and I have about 3 levels of this.

What I'd want is to have the script be more efficient and less(one script for each level rather than one script for each link) and somehow use a variable and switch to decide what to show the user. I'm told I can have a "name" attribute inside the anchor tag for the link so each link has a name that I can use as a variable in the script. I'm not sure however, how I can pass that name to the script.

I'm very new to PHP and any help at all is greatly appreciated!

Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Web link and PHP

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3030
  • Posts: 10,567
  • Joined: 08-August 08

Re: Web link and PHP

Posted 30 May 2010 - 07:17 PM

This sounds like you need to learn HTML as well as PHP. Start by reading through the tutorials on this site.
Was This Post Helpful? 0
  • +
  • -

#3 sheraush  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 24-January 10

Re: Web link and PHP

Posted 30 May 2010 - 07:45 PM

Thanks for the reply. I do know the basics of HTML. I just didn't learn how to use it with PHP. I take it from your reply it might be as easy as using the "name" of the link inside the script...

I'll go ahead and read see if I find a solution to my question in the HTML section. This isn't for a class by the way, I'm trying to teach myself PHP because they don't teach it at my school.

Thanks again!
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3030
  • Posts: 10,567
  • Joined: 08-August 08

Re: Web link and PHP

Posted 31 May 2010 - 05:40 AM

PHP outputs to the browser, so if your code outputs proper html then the browser will use it:
echo "<b>Hello World!</b>";


will display as
Hello World!
in the browser.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1