View Full Version : integrating a PHP app with VB


Kingskin
8th February 2004, 05:41 PM
Hi guys :)

im in the process of writing a PHP app that runs independantly from VB with its own MySQL database (its just a simple data entry & retreival program). It allows people to submit reports by answering questions. One of the peices of info i need to include is the username of the person submitting the report, but at the moment this has to be typed in, meaning people can use any old screen name. What id like is for it to detect a persons username using bbuserifo so that it is displayed automatically or else asks them to log in. How do i do this? I'd be really grateful for any help you can give me :)

Thanks

:)

Disjunto
8th February 2004, 06:16 PM
it would be a lot easier making it use the same database as vB does, mainly because you could simply check the users username from the same db. although you could make it use both databases. don;t ask me how, it aint my subject :)

Kingskin
8th February 2004, 06:54 PM
thanks breaker - im open to all suggestions, like i say this is my first program, and it only uses 1 table anyway so i could do that, but say i included it as a table in my VB database, how do i go about using the $bbuserinfo etc. variables? Can i just use them of do i need to do something to the PHP files ive written :)]
thanks for your reply ;)

Disjunto
8th February 2004, 07:45 PM
well as i said, databases aren't my subject :| I might be able to help more if you provide what version of vB you are using.

Kingskin
8th February 2004, 08:06 PM
well as i said, databases aren't my subject :| I might be able to help more if you provide what version of vB you are using.sorry that would help wouldnt it! VB3 rc2 :)

Kingskin
9th February 2004, 06:26 AM
OK i seem to have it working by adding

require("global.php");

at the top of my files, but i would like to be able to do this with files in folders rather than the root. So global.php is in www.mysite.com (http://www.mysite.com) but my files are in www.mysite.com/myfiles (http://www.mysite.com/myfiles), so obviously just saying global.php gives an error as only the current directory is scanned. Can anyone tell me what i need to do?

Disjunto
9th February 2004, 10:06 AM
you should use:

require_once("../global.php");

or something along those lines

Shaz
9th February 2004, 09:32 PM
use the chdir to change to main folder, then call the global.php, then change back to myfiles

If I'm understanding the chdir function correct.

Shaz