Solved

put a variable into a hidden field

Posted on 2011-03-06
2
322 Views
Last Modified: 2012-08-13
I have created a sum and my result is $result

I tried putting $result into the hidden field but it wouldn't insert into my database. For example, a value of <?php echo $_POST['rqty']; ?> worked. What would i have to change $result to in order to get it to insert into my database?
0
Comment
Question by:jonofat
2 Comments
 
LVL 4

Expert Comment

by:florjan
Comment Utility
Do you get result inside of a function? if so try putting global $result; in function.
function some_function() {
global $result;

Open in new window

0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
tried putting $result into the hidden field

Do you mean into a type=hidden input control of HTML forms?  If you can show us the code you are using we can surely help you with this.  To echo a string into the HTML you can do something like this:

<form>
<input type="hidden" value="<?php echo $result; ?>" />
</form>

Not sure about the data base part until we see the code you are using to create the query.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now