Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 02-23-2009, 03:57 AM   PM User | #1
Becca800
New to the CF scene

 
Join Date: Feb 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Becca800 is an unknown quantity at this point
_POST Syntax from HTML Form

Hello all and thanks in advance for any help. I am using Joomla and chronoforms (a joomla extension) to upload data into mysql from a form which a user fills out. I am having one issue with the following part:
PHP Code:
<?php
$_POST
['type'] = 'component';
$_POST['componentid'] = '20';
$_POST['parent'] = '0';
$_POST['checked_out_time'] = date("Y-m-d H:i:s");
$_POST['link'] = 'index.php?option=com_content&view=article&id=';
$_POST['published'] = '0';
$_POST['checked_out'] = '0';
$_POST['sublevel'] = '0';
$_POST['params'] = 'show_noauth=
show_title=
link_titles=
show_intro=
show_section=
link_section=
show_category=
link_category=
show_author=
show_create_date=
show_modify_date=
show_item_navigation=
show_readmore=
show_vote=
show_icons=
show_pdf_icon=
show_print_icon=
show_email_icon=
show_hits=
feed_summary=
page_title=Best ' 
$city $state 'Home Stager 
show_page_title=0
pageclass_sfx=
menu_image=-1
secure=0'
;
?>
This is the very end of the form and is activated upon submission. Everything is posted correctly except for the page title. The page title just shows as Best Home Stager. The city and state variable are coming from the form itself, these form fields have ids and names with 'city' and 'state' respectively. Am I going about this incorrectly?...as I am trying to post the variables from the form in this manner?
Becca800 is offline   Reply With Quote
Old 02-23-2009, 04:01 AM   PM User | #2
`Jeremy
New Coder

 
Join Date: Feb 2009
Posts: 32
Thanks: 0
Thanked 4 Times in 4 Posts
`Jeremy is an unknown quantity at this point
You need to make their names city and state, not their ids.

Also, you need to either use $_POST['city'] and $_POST['state'] or before $city and $state are used, do $city = $_POST['city']; and $state = $_POST['state'];
`Jeremy is offline   Reply With Quote
Users who have thanked `Jeremy for this post:
Becca800 (02-23-2009)
Old 02-23-2009, 04:14 AM   PM User | #3
Becca800
New to the CF scene

 
Join Date: Feb 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Becca800 is an unknown quantity at this point
thanks

The names are city and state, as I said above, and the ids as well. THank you, the first suggestion did not work but the second one partly did. When I entered Houston TX into the form I got:

Best Houston0Home Stager

So I got the city, but not the state. Same code as above but added:
PHP Code:
$city $_POST['city'];
$state $_POST['state']; 
above it all.
Becca800 is offline   Reply With Quote
Old 02-23-2009, 04:23 AM   PM User | #4
Becca800
New to the CF scene

 
Join Date: Feb 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Becca800 is an unknown quantity at this point
For some reason, the state variable is not going through. I will forge on and figure it out, thanks for helping though, you helped me tremendously.

UPDATE: Yeah, I am a foobar in the flesh. I already had another variable named state in some syntax above that equaled to 0.

Last edited by Becca800; 02-23-2009 at 04:35 AM..
Becca800 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:24 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.