Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Easy question about $_GET command !!!!NEED HELP!!!
Old 11-07-2007, 11:54 AM Easy question about $_GET command !!!!NEED HELP!!!
Junior Talker

Posts: 4
Name: Phil
Trades: 0
I have a simple question.
i am trying to get a variable from my url : http://www.mywebpage.com/quote_form.html?id=1397

my code looks like this:

<head>
<title>quote form</title>
</head>
<body>
<?php
$id = $_GET['id'];
echo $id;
/?>
</body>
</html>

however id does not show up.
Is this caused because i'm trying to get the variable through a .html extention?
Or is it becuase it is only a link that contained the id variable not a form on the previous page?

I hope this made sense because i need some serious help.
Gathos is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-07-2007, 12:16 PM Re: Easy question about $_GET command !!!!NEED HELP!!!
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
I assume the file needs to be .php unless you add an apache handler.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 11-07-2007, 12:22 PM Re: Easy question about $_GET command !!!!NEED HELP!!!
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
First, in most situation it is not at possible to run php script in html. You need php extension. Second, how I know, you cannot to close /?> php tag like in your example, ?> is right.

Shivaji
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels

Last edited by shivaji; 11-07-2007 at 12:24 PM..
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 11-07-2007, 12:25 PM Re: Easy question about $_GET command !!!!NEED HELP!!!
Junior Talker

Posts: 4
Name: Phil
Trades: 0
thank you both very much ... hehehe this was an easy quetion but has stumped me for a long time thank you.
Gathos is offline
Reply With Quote
View Public Profile
 
Old 11-13-2007, 11:42 PM Re: Easy question about $_GET command !!!!NEED HELP!!!
Novice Talker

Posts: 13
Trades: 0
if you are running apache you can add .html to the line AddHandler line in the httpd.conf or php.conf as in my case.

Code:
AddHandler php5-script .php .html
AddType text/html .php .html

The issue with doing this is that EVERY file.html that gets served by the web server will be parsed by the PHP engine, which will slow down the web server.
__________________

Please login or register to view this content. Registration is FREE
- Find your Stuff!

Please login or register to view this content. Registration is FREE
- Merchant Accounts for Business

Please login or register to view this content. Registration is FREE
- ECommerce Solutions
ericsante is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Easy question about $_GET command !!!!NEED HELP!!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14754 seconds with 12 queries