Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Login to remove all ads!
Reply
 
LinkBack Thread Tools Display Modes
Old August 6th, 2003   #1 (permalink)
Memories are all I have..
 
Janus's Avatar
 
Join Date: Apr 2001
Location: In my memories...
Posts: 423
Php Help

Ok guys..I got 2 files. a html file and a php file.
Im linking my php files to a SQL server. now for my php file i had this:
Quote:
(form action="../Cain/MsSql.php" method=post)

Please Input SQL Server Username
(input type="text" name="myUser")

Please Input SQL Server Password
(input type="text" name="myPass")

(input type="submit" name="submit" value="Authenticate SQL")
(/form)
for my php script i got this:
Quote:
<?php

$myServer = "127.0.0.1";

$myDB = "Northwind";

$s = @mssql_connect($myServer, $myUser, $myPass)

or die("Couldn't connect to SQL Server on $myServer");

$d = @mssql_select_db($myDB, $s)

or die("Couldn't open database $myDB");

?>
Now i cant seem to link them together. The user name and the pass just dont seem to go into the connect statement. Any ideas?
__________________
When the pages of the book of my life ends. You'll be the most colourful chapter i ever had. If it'll be open again, i'll start with the moment i knew you.
[sig=390]
Janus is offline   Reply With Quote
Old August 10th, 2003   #2 (permalink)
.:: PHP King ::.
 
Mohd's Avatar
 
Join Date: Mar 2002
Location: Bahrain
Posts: 580
put this at the top of your php script

PHP Code:
$myUser $_POST['myUser'];
$myPass $_POST['myPass'];

if(empty(
$myUser) || empty($myPass))
die(
'Missing Field'); 
Mohd is offline   Reply With Quote
Old August 11th, 2003   #3 (permalink)
NSBQ nut
 
Nezzar's Avatar
 
Join Date: Aug 2001
Location: .de
Posts: 1,208
Your host has most likely deactivated register_globals (as Mohd said).
You might want to use this: http://www.php.net/import_request_variables
__________________
Bred for its skills in magic
Nezzar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 20:57.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5