Passing Values

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

crzyman
Forum Newbie
Posts: 18
Joined: Fri Sep 16, 2005 10:44 pm

Post by crzyman »

Yes on get_name.php I have:

Code: Select all

$name = $_POST['title'];
But the value is not being passed via the form? I am stumped. Its one in the morning and I am tired. Will tackle this in the morning. Thank you all and good night.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You are defining $name, but are echoing $title.

Which do you want to use? :P
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

blacksnday wrote:btw.. How can i donate to these forums?
I remember jason (the owner of this site) having PayPal account for donating to the forum... lemme look around....

okay.. I believe it'd be jason [at_ devnetwork *dot^ net

at least that's what it was 18 months ago according to archive.org ...
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

crzyman wrote:I tried this, but it still won't pass the value. I want the value of $title to be passed to get_name.php. I am still new to php, so please forgive my lack of knowledge.

Code: Select all

<? $title = "name"; ?><FORM METHOD="POST" ACTION="/my_page/names/get_name.php"><input type="hidden" name="<?php $title ?>"  value="<?php $title1 ?>" >
sorry, based on your previous post it should be something like
$title = $POST['name'];

anyways, I think
$variable = $POST['formfieldname'];

then use the $variable whenever you want to retrieve the value.
But only if its from a form... if its from SQL then it's a tad bit different?
should mainly be used when wanting to pass form values?
At least for my News Script Code, this has worked everytime.....
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

That is what he's trying to do, blacksnday.
Post Reply