Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-22-2003, 10:20 AM   #1 (permalink)
Odoggy5
Code Monkey
 
Odoggy5's Avatar
 
Join Date: Aug 2003
Location: SF
Posts: 47
Odoggy5 is on a distinguished road
Send a message via AIM to Odoggy5
true noob

Hey Everybody,
I am a true noob to MySql and PHP. I have been messing around with HTML and CSS for the last year or so and feel I have real solid grasp on that so it is time to move on! I just successfully installed Apache, PHP and MySql on my system and have started to mess around with it. I got this real basic code I was having trouble with and wondering if somebody could tell me what I am doing wrong. I am showing the contents of my html file and my php file. All I am trynig to do is display this guys name in the next screen. Thanks!:rock:

<html>
<head>
<title>welcome test</title>
<body>
<a href="welcome.php?firstname=Kevin&lastname=Yank">H i, I'm Kevin Yank! </a>
</body>
</html>

here is the php file.
<html>
<head>
<title>Welcome test php doc</title>
</head>

<body>
<?php
echo( "Welcome to our Web site,$firstname $lastname!" );
?>
</body>
</html>
Odoggy5 is offline   Reply With Quote
Old 08-22-2003, 11:07 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
PHP Code:
<?php 
echo( "Welcome to our Web site,$firstname $lastname!" );
?>
for this to work.. you must go into your php.ini file and set register_globals = on

otherwise, use the code below:
PHP Code:
<?php 
echo( "Welcome to our Web site,$_GET['firstname'] $_GET['lastname']!" );
?>
happy coding =)
__________________
Mike
sde is offline   Reply With Quote
Old 08-22-2003, 12:42 PM   #3 (permalink)
Odoggy5
Code Monkey
 
Odoggy5's Avatar
 
Join Date: Aug 2003
Location: SF
Posts: 47
Odoggy5 is on a distinguished road
Send a message via AIM to Odoggy5
I was looking in the PHP.ini file and it suggests not to turn on register_globals for security. So I guess Ill go with the latter suggestion thanks, Mike.

Dude,..this rock on smilie is the shiznit!:rock: :rock:
Odoggy5 is offline   Reply With Quote
Old 08-22-2003, 01:21 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
hah .. had no clue it was you. :rock:
__________________
Mike
sde is offline   Reply With Quote
Old 08-22-2003, 01:31 PM   #5 (permalink)
Odoggy5
Code Monkey
 
Odoggy5's Avatar
 
Join Date: Aug 2003
Location: SF
Posts: 47
Odoggy5 is on a distinguished road
Send a message via AIM to Odoggy5
I tried both, the first one worked the second did not.
Odoggy5 is offline   Reply With Quote
Old 08-22-2003, 01:46 PM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
PHP Code:
<?php 
echo( "Welcome to our Web site," $_GET['firstname'] . " " $_GET['lastname'] . "!" );
?>
maybe you need to isolate the variables outside of the string. try that.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP deperately need help plz!!! RusH MS Technologies ( ASP, VB, C#, .NET ) 2 10-03-2004 06:42 PM
OpenGL.dll Mr.Anderson Platform/API C++ 3 08-13-2004 11:07 AM
My game Dodo Standard C, C++ 2 06-27-2004 11:48 AM
help im a noob CaN Opener PHP 4 10-10-2003 04:15 PM
grr... stupid gcc hazmat Standard C, C++ 8 05-18-2003 10:37 PM


All times are GMT -8. The time now is 11:04 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting