Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 27th, 2004, 08:26 AM
Authorized User
 
Join Date: Jun 2004
Location: Oslo, , Norway.
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.
Reply With Quote
  #2 (permalink)  
Old June 27th, 2004, 10:21 AM
Authorized User
 
Join Date: Jun 2004
Location: Oslo, , Norway.
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.
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 11:29 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.