TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-27-2009, 09:39 PM   #1 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default $_POST problem

I working on another "learning" project. In this one, I am attempting to move a radio button selection ("varname") to another page in order to do a MySQL query, etc., using the $_POST method.

Both of the lines below seem to work the exact same within the HTML table statements that I'm using. However, with #1, the $_POST turns up empty. With #2, the $_POST does have the appropriate value.

1. <?php echo "value = $varname" ; ?>

2. value = "<?php $varname ?> "

What is the difference?

Thanks.
Dave is offline  
Reply With Quote
Old 10-27-2009, 09:49 PM   #2 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default

Wait...

Should statement #2 be...?

value = "<?php echo $varname ; ?>"

...Just thought about the ECHO.

Dave
Dave is offline  
Reply With Quote
Old 10-27-2009, 10:10 PM   #3 (permalink)
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default

Yesss! The echo solves the problem!
Dave is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB 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
Stream problem Tanax Advanced PHP Programming 9 06-10-2009 12:33 PM
problem getting data on the html table.... jetnet1 General 2 11-24-2008 06:55 PM
Huge Session Problem Killswitch General 1 11-17-2008 02:36 AM
A serious curl checkbox problem bedri Advanced PHP Programming 1 05-22-2008 04:25 PM
A bug or a cache problem?! yazid Advanced PHP Programming 0 05-22-2008 08:40 AM


All times are GMT. The time now is 12:07 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design