Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

get a $_POST value in a Function

images php coding issues or problems here.

Moderators: macek, egami, gesf

get a $_POST value in a Function

Postby Phoenix » Tue Nov 08, 2011 10:49 pm

HI

I have a function that upload images into mysql. The problem is that I want to use a POST value that I get from a form and use it in the function. If I echo in front of the function I get the value but inside I get no value.

Is it about global variables? And how can I do it.

:help:
Phoenix
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Nov 08, 2011 10:38 pm

Re: get a $_POST value in a Function

Postby egami » Wed Nov 09, 2011 5:24 am

$_POST, $_GET, $_SESSION, $_SERVER are "Super Globals"

Meaning, that they should work inside of functions. They do work, because I do it all of the time.


function Show_Me_The_Money() {
echo '<font style="font-size:24px; font-family:arial; font-weight:bold;">'.$_POST['show_me'].'</font>';
}
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: get a $_POST value in a Function

Postby Phoenix » Wed Nov 09, 2011 9:28 am

Thank you, for the respons.

I will keep on trying until i get it working, now i know it must work.

Thanx
Phoenix
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Nov 08, 2011 10:38 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron