Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 February 5th, 2007, 01:22 PM
Registered User
 
Join Date: Feb 2007
Location: Newark, NJ, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forum help - Mike Myatt

Hello my name is Mike Myatt and i have a problem with a php forum:

I am trying to create a simple form where the user enters there favorite activity into a textbox and when they click submit they are taken to my php page where it says "your favorite activity is: (Whatever they entered in the textbox)". for this i am using the method=get and i can see on the php page that the name/values are working properly. However i am not seeing it display properly in the body of the page.Does anyone have any ideas on how to get the form to work poperly?

Thank you in advance and all the best.

Mike Myatt.

mike myatt
 
Old February 6th, 2007, 12:07 AM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi! Mike Myatt

just echo the name of the text box in which u r feeding ur favourite activity.
<form action="a.php">
<input type ='text' name='activity'>
<submit>

and on ur a.php page type
echo $activity;

thanx
Raaj



 
Old February 12th, 2007, 07:04 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Mike


As per your topic u form tag maybe like this as below

<form action="abc.php" method="get">
<input type="text" name="activity">
</form>

In abc.php

u write

<?php
$activity=$_GET["activity"];
echo "Your favorite activity is :".$activity;

?>

since you are using "get" method u should use $_GET["activity"] if u using "post" method then use $_POST["activity"]


i hope this will solve ur problem. plz do let me know if u prob is solved or not.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Mike Myatt, CSS Conversion qedonline CSS Cascading Style Sheets 9 January 29th, 2007 11:07 PM
How can I creat a forum like P2P Forum? pcassiano ASP.NET 1.0 and 1.1 Basics 1 October 31st, 2005 05:00 AM
Which Forum? fishypew SQL Server 2000 1 May 12th, 2005 09:52 AM
converting Forum.aspx to Forum.ascx (help) drfunkie BOOK: ASP.NET Website Programming Problem-Design-Solution 1 July 11th, 2003 12:27 PM





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