Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old January 27th, 2003, 10:17 PM
spenney spenney is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 16 spenney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing variables from one html page to another...

Hi,

I am trying to follow a simple example for posting variables from one web page to another....I was hoping someone might be able to explain what this error means to me!

this is where i pass my variable name:

<html>
<head><title>Testing Vars </title></head>

<body>

<a href="welcome.php?$name=Kevin">Hi, I'm Kevin! </a>

</body>
</html>

and this is where i am getting my error:

<html>
<head><title>Welcome Page</title></head>

<body>

<?
echo ("Welcome to our Web Site, $_GET['name']!");
?>

</body>
</html>


this is what the error says:

Notice: Undefined index: 'name' in E:Inetpubwwwrootallnorth_testwelcome.php on line 10
Welcome to our Web Site, !

I know this is a very simple example, but i have to figure this out in order to apply it to what i am doing....in which i am getting the same errors only there is so much code that i cannot figure it out!!

i hope someone can help,
thanks.

sp

Reply With Quote
  #2  
Old January 27th, 2003, 10:31 PM
filefrog filefrog is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: West Peoria, IL
Posts: 62 filefrog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to filefrog
RE: Passing variables from one html page to another...

In your link's href attribute, you need to remove the $ from the front of the variable name you are passing.

i.e.:
<a href="welcome.php?name=Kevin">welcome</a>

In your code, (if you do a print_r($_GET), which will dump the contents of the $_GET array) you will notice that there is an index named '$name' (literal $) with the value 'Kevin'.) So if your echo line had been:
php Code:
Original - php Code
  1.  
  2. echo "Welcome to the website
  3. ' . $_GET['$name'] . "!";


it should / would have worked.

Reply With Quote
  #3  
Old January 27th, 2003, 11:06 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Passing variables from one html page to another...

$_GET['name'] should work fine, but when calling an array within a string you need to surround it w/ curly braces - {$_GET['name']}

Reply With Quote
  #4  
Old February 4th, 2003, 05:05 PM
noob noob is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 6 noob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Passing variables from one html page to another...

hey fellas

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Passing variables from one html page to another...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway