Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2004, 08:26 AM
Authorized User
 
Join Date: Jun 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default !resolved! - a change in coding style

I know i can change
(HTML inside echo statements)
echo "What grade did $Name get in Math?";
to
(PHP inside HTML)
What grade did <?php $Name ?> get in Math?
and it will work.

But how do i change
echo "<input type=hidden name=Student[] value='$Name'>";
to something similar?

I've tried using
<input type="hidden" name="<?php $Student[] ?>" value="<?php $Name ?>">
and
<input type="hidden" name="Student[]" value="<?php $Name ?>">
but neither will work.
What this code is supposed to do is create an array called $Student which i need to call on in the next page which processes the form.

Can anyone help or must i use HTML inside an echo statement for this to work?
__________________
grimmy
God, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to hide the bodies of those people I had to kill because they pissed me off.
 
Old June 27th, 2004, 10:21 AM
Authorized User
 
Join Date: Jun 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

through the age old miracle method of tinkering, i figured it out.

the problem of the $Name value not getting passed on, was due to the fact that the value wasn't stated in the form.
i resolved that issue by changing <?php $Name ?> to <?php echo $Name ?> and thereby actually using the value in the form.

in other words, a sloppy mistake on my side.





Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic change of style rajesh_css Javascript 3 October 10th, 2008 04:45 AM
change style.backgroundColor the reset all others crmpicco Javascript How-To 2 September 29th, 2005 09:52 AM
C# coding style csharplearner C# 5 April 27th, 2005 03:16 PM
Change style attribute of a WebUserControl YiannisF ASP.NET 1.0 and 1.1 Basics 1 July 10th, 2004 02:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.