FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Please help.....Flash, PHp, MySql





vinx_18
Here's the situation....

I have my button which links to a page...
the code in flash is :
Quote:
on (press){
var userorig = _global.userorig;
loadVariableNum ("http://localhost/index.html", 0 , "POST");
getUrl("http://localhost/index.html","_blank");
}

while in PHP is :
Quote:
<?
$username = $HTTP_POST_VARS['userorig'];
mysqlpconnect.....etc. etc.
if (isset($_POST['create'])) ---->this is true if create button(code found at the later part of the code) is click.
{
etc. etc..

The problem is that it does not work sometimes....I wonder if this has something to do with the if (isset....) thing coz when I erase it...the code works smoothly. But I have to put the if (isset...) coz i want the user to click the button before executing the code inside the if (isset...)...
Is there other way to do this other than if (isset....)
phileplanet
I'm not sure about this but isn't the flash part suppose to be
Code:
on (click){
or something else?
vinx_18
nah....it could be ..on (release) .... or on(rollOver) ....etc. it all works....but I think the problem is in my php code...
n0obie4life
Try

Code:
echo $username;


somewhere in your code. If $username doesn't show, there's something wrong with the flash side Wink.
Sappho
Flashside seems correct even if u would use the new loadVars object to handle the communication instead of old loadVariables couse it offers more control with even handlers.

BTW i dont see u sending create anywhere in ur flash code, i am assuming u r setting it with the other button correctly to the movie clip that is handling it.

Oh and i would rename the html to php extension as anything that has php code within it.

About the PHP side, why using $HTTP_POST_VARS use just $_POST["userorig"] ofcourse if u dont run old PHP version but that has prolly nothing to do with the problem.

U can try to avoid using isset too:

Code:

<?
$username = $_POST['userorig'];
$create = $_POST["create"];

mysqlpconnect.....etc. etc.
if ($create == "submitted")
{
etc. etc..


of course u would need to send "submitted" in as a string or go just with a boolean doesnt matter...

But truth is i didnt find any bug in ur code so it should run as it is, all my comments are just for u to try things differently.
vinx_18
Thanks guys...

I'll try all your suggestions...Anyway, I have also found one solution and that is setting up a cookie...and gladly it works...But I'll try your suggestions...By the way, thank you so much...I do appreciate all your help...
Related topics
simple php problem, please help...
phpBB2 ERROR PLEASE HELP
Need Help in PHP
please help me, i don't know anything here...
Please help me!!!! HTML/Flash help needed!
Problem with MySQL Server Please Help!!
mysql base error please help
A very good PHP MySQL Tutorial
HELP on PHP MYSQL : everything MESSED UP
THIS IS DRIVING ME INSANE!! PLEASE HELP!
Flash, PHP and MySQL
Need Expert help in php-mysql
PHP MySQL Question
Help regarding Php & MySQL
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.