Jump to content

Recommended Posts

hello

 

i am looking forward to posting at this forum. i am a member at a few others. just started to do php but have programed in other languages (C, VB.NET and shell) but want to get into DB's and the such like. anyway enough of my mindless drivel.

 

i am a little embarrassed to say that i can't get my first program to work ( close as dam to hello world). i am learning from a php4 book and using php5, on apache, on ubuntu- maybe relevant, not sure, as the code looks ok but does not work (i say this but what do i know this is my first program).

 

if some one could take a quick look and point out where i have gone wrong that would be great.

 

<html>
<head></head>
<body>
<form method=post action="testphp.php">
what are your favorite web sites?<br>
<textarea name="websites" cols="50" rows="5">
http://
http://
http://
http://
http://
</textarea>
<br>
<br>
<input type=submit>
</form>
</body>
</html>

 

 

<html>
<head></head>
<body>
your favorite sites are:
<?php
echo $websites;
?> 
</body>
</html>

 

i think that the scripting engine is working as i can initialize and echo variables if i use them on the same page.

 

hush

Link to comment
https://forums.phpfreaks.com/topic/46324-get-and-post-not-working/
Share on other sites

Try $_POST['websites'] instead.

 

Your code is using old coding syles. it require register_globals - which is now depreciated and is being phased out.

 

You should update your coding style to use superglobals to get data from GET, POST, COOKIE, SESSION, SERVER etc.

 

 

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.