p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

beginning_php thread: need HELP with PHP

Message #1 by "milko milkov" <m_milkov@h...> on Sun, 02 Feb 2003 00:51:33 +0000
Hi, dear WROX programmers. I recently purchased a book of yours, called Beginning PHP. I loved how much
that language appealed to me, until one of the source code examples in that book did not work. Logically, it should work, it just
doesn't, and since it's one about declaring a variable outside a php file, it's vital to my advance. I am hereby sending you the
code which is entered in the HTML file, followed by the php one. Please, reply to me at m_milkov@h..., to let me know what
might be wrong. text.html : 

Who is your favourite author? 



and here is text.php : 

Your favorite author is: 

echo $Author; 


You see, it should work, but all I get is "Your favorite author is: " and no input. What's wrong?!? Reply, plese. 
Cordially yours:
Milko D. Milkov
MSN 8 helps ELIMINATE E-MAIL VIRUSES.  Get 2 months FREE*.
Message #2 by "Gellings, C.O." <gellingsco@p...> on Sun, 02 Feb 2003 10:02:29 +0100
Where do you set a value to $Author ??? because like this the value stored 
in $Author = null or '' (nothing). so somewhere you should set a value. 
That can be done by a form's
<form name="author" method="get" action="....php">
<input type="text" name="Author" value="">

<select name="Author">
<option value="xxx">xxx</option>
<option value="" selected>Make your choice</option>
<option..... etc
<input type="submit" value="Submit" name="submit">
But like this nothing will ever come as your favourite author. You can set 
it fixed as wel like

$Author = "Shakespear";



  Return to Index