Avatar of phillystyle123
phillystyle123Flag for United States of America

asked on 

multiple posts in one $this->request->post['name']

I'd like to be able to use another post in my $this->request statement

turn this

$this->request->post['name']

into this

$this->request->post['name'] post['lastname']

getting an error with everything i try -any ideas?
PHP

Avatar of undefined
Last Comment
phillystyle123
Avatar of dsmile
dsmile
Flag of Viet Nam image

$this->request->post['name'] post['lastname'] is not a valid php syntax.

Don't know what kind of framework you're using, but I guess $this->request->post is an array that contains all your POST values.

If lastname is a field in the POST form, then you can retrieve it by calling

$this->request->post['lastname'].

If this doesn't work, then you need to provide more specific info like which framework you're using, what exactly do you need, and what error you're getting.

By the way, since you can call $this->request->post['name'], try print_r($this->request->post) to see how many POST values you can get from there.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of phillystyle123

ASKER

pefecto -thanks
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo