General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 9th, 2003, 09:45 PM
andyyylz andyyylz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 14 andyyylz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
why i can not transfer value via web pages

in test1.htm
<form action="test2.php" method="get">
<input type="text" name="t1">.....
......
</form>

in test2.php
<p>you write: <?=$_get['t1']?> </p>


But i can not get any value what i input.
I am a newer for PHP. Anyone can reply me?


Cheers!

Reply With Quote
  #2  
Old July 9th, 2003, 10:24 PM
Brenton Brenton is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Adelaide, Australia
Posts: 1 Brenton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try..

in test2.php
<p>you write: <? echo $_get['t1']; ?> </p>

Reply With Quote
  #3  
Old July 10th, 2003, 01:58 AM
mg03 mg03 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 7 mg03 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If that doesnt work try this:

PHP Code:
<p>you write: <? echo $HTTP_GET_VARS['t1']; ?></p> 

Reply With Quote
  #4  
Old July 10th, 2003, 02:14 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
$_GET must be ALL CAPS.

And for the record, <?= is shorthand for <?php echo

It's very useful for when you want a quick in-n-out of PHP just to display one value.

Last edited by avit : July 10th, 2003 at 02:23 AM.

Reply With Quote
  #5  
Old July 10th, 2003, 04:53 AM
andyyylz andyyylz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 14 andyyylz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you all:

I tried, but i can not run properly yet. Why..........

Reply With Quote
  #6  
Old July 10th, 2003, 05:07 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
I assume that you have a submit button in your form? (It's just that I don't see it in your example)

Otherwise, it should work. What do you get in your output? Does it just show nothing?

Make sure you check your capitalization:

PHP Code:
<p>you write:*<?=*$_GET[t1]*?></p> 

Reply With Quote
  #7  
Old July 12th, 2003, 11:17 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
First off it might not be working correctly because of the way you have your php file started...

try this for test2.php
PHP Code:
<?php
  $T1 
$_GET['t1'];
  echo 
"<p>\nyou write: $T1\n</p>";
?>

Also, make ksure that t1's capitolization is correct, if it's T1 in your code and through the header in the url, then it'll need to be T1 in the $_GET['T1'] portion of your code

Hope this helps

Reply With Quote
  #8  
Old July 14th, 2003, 08:24 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by avit
$_GET must be ALL CAPS.

And for the record, <?= is shorthand for <?php echo

It's very useful for when you want a quick in-n-out of PHP just to display one value.


You should be careful with this though... Not all server configurations are setup to accept the shorthanded method, which is why it's always recommended to use the long version (not really long since it's 2 extra characters).

TO ensure portability, use the longhanded version...
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > why i can not transfer value via web pages


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT