Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass variables from Shockwave to php?

Status
Not open for further replies.

askisk

Programmer
Aug 6, 2001
1
SG
Hi, I hope someone can help me on this.

I'm working on a Shockwave application, whereby a user can submit a username and password. It will then query a .php3 document and checks the database whether such a user exists.
Anyway this is what I have so far in Lingo:

on mouseUp

user= member("txtUsername").text
password = member("txtPassword").text
infoList = ["phpuser": user, "phppassword": password]
netID = postNetTexT(" infoList)

end

And in php I have:

$query = "SELECT * FROM mydb WHERE user LIKE #phpuser# AND password LIKE #phppassword#";
$result = mysql_query ($query)
or die ("Query failed");

I seem to always get "query failed" because I think the problem of passing the data over from Lingo to the php3.
It works fine when I do a simple a "select * FROM mydb" or
"select * FROM mydb where user LIKE "yourname"".

Maybe someone can help me and point out what am I doing wrong?

Cheers,
Isk.
 
Is the entire site using shockwave?? If so...maybe you can incorporate it so that the html file has html in it for the php call. Although that should not be the problem...

I'm a little confused with the #phpuser part & the LIKE statements (btw what DBMS are you using?). If you can post the complete php, and a link to the page you are trying to work with...it will help alot.

I'd do it like this:

$query = "SELECT * FROM mydb WHERE user=$phpuser AND password=$phppassword";
$result = mysql_query ($query)
or die ("Query failed");

Ofoucrse your gonna want the form fields to be named "phpuser" and "phpassword" ..or whatever you want them to be named. And then have the form action go to the script that you want to query the database.

HOPE THIS HELPED! WASN'T MUCH I KNOW... - PAINKILLER
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top