?
Solved

...

Posted on 2000-02-16
8
Medium Priority
?
254 Views
Last Modified: 2006-11-17
Here goes my last 50 points... Just cause I'm too lazy to look in a book for the answer...
OK I'm trying to learn how to use PHP. I can use Cold Fusion fairly well but that's not all that much like PHP.
My question is...
In Cold Fusion you can call on a variable in the 'location' in the browser... for example
index.cfm?thread_ID=4444
where the variable thread_ID is 4444.
so is it possible to do this in php?
ex index.php3?thread_ID=4444
I need this so that when a user clicks on a thread in my forums they can click on the url ?thread_ID=???.
So I know this is possible.. Could you please give me the code to call it from the URL...

thank ya...

- Mike Page
www.idev.org
webmaster@supercool.org
ICQ: 829645
0
Comment
Question by:SuperCool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Accepted Solution

by:
gravity earned 200 total points
ID: 2529594
Yep, that's how you set variables.

For example :

<A HREF=mypage.php3?variable=test&variable2=anothertest>Click here!</A>

Will go to mypage.php3 and set $variable to 'test' and $variable2 to 'anothertest'.

0
 

Author Comment

by:SuperCool
ID: 2529679
ya.. that i could have figured out myself...
but i need to know how to access those variables from my page....
for example i want it to...
select * where thread_id = #URL.Thread_ID#

(#URL.Thread_ID# the equivelant as a CF tag)

- Mike
0
 
LVL 2

Expert Comment

by:gravity
ID: 2529712
Is the following what you're after ?

<?
    $sql = "select * from table where thread_id='$thread_id'";
?>

where $thread id is the value passed by the URL ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:SuperCool
ID: 2529760
so simple? sounds good to me...
0
 
LVL 2

Expert Comment

by:freshmeat
ID: 2529955
yes!
that is why php cooler than asp!
simpler is better!!
:)
i like php!!
^@^
0
 

Expert Comment

by:tejass
ID: 2530867
It is much simpler than that. You just use the variable $thread_ID in the page that is being called.
0
 

Author Comment

by:SuperCool
ID: 2530882
question was already answered
0
 
LVL 2

Expert Comment

by:gravity
ID: 2531676
Groovyness is PHP indeed... one other shortcut you might find usefull :
You know the start and end PHP tags, ie <? and ?> ?
Well, you can use them really usefully to separate HTML in if statements, e.g. :

<?
    if (statement) {
?>
<SOME HTML>
<?
    } else {
?>
<SOME OTHER HTML>
<?
    }
?>
This quite usefull as it means you don't have to format the HTML you want to output using echo or whatever.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question