JohnDotOwl
JohnDotOwl

Reputation: 3755

Issues with passing PHP echo in form through POST method

<form method="POST" name="send"
<input type="hidden" name="title" value="<?php echo ($pro->title;?)">
</form>

I dont want people to see the hidden informations , Is this the best way to pass the variable over to my controller?

This the code in my controller

$this->email->subject('subject '.$_POST['title'].' ' );

Thank you!

Upvotes: 1

Views: 179

Answers (1)

StaticVariable
StaticVariable

Reputation: 5283

<form method="POST" name="send"
<input type="hidden" name="title" value="<?php echo ($pro->title;?)">

should be

<form method="POST" name="send">
<input type="hidden" name="title" value="<?php echo $pro->title; ?>" />

For this i will suggest you to use SESSION because hidden fields can be changed.

Upvotes: 3

Related Questions