Jump to content

aaronrb

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by aaronrb

  1. Hello i would liek to know if this is the correct way to work on my project before i spend loads of time working on it and it doesnt work. i woudl like to create a huge list so that me and my friends can add the films that we own. i would liek the first page to have a text box or a drop down menu so that they can select how many films they wanna add at any one time. and then it will move on to the next page with that desired amount of textboxes. now the way that i would image this was done, was to use a foeeach statement. would i be right in saying this?? and also if this is the way, as i have never used this before how would i go about adding it to mysql db. thanks in advance. Regards A
  2. ok, cool, but i havent got a clue whether apache is running or not, as i am using a free web host, and i cant find any info on that. as for username and password, they are in a mysql database.
  3. hey All, i have cheked out about 4tutorials on Http authentication including the one on php freaks, which was the first. i am having some problems with it, being that i put the username and password in and all it does is reopen the password box. i did think that maybe my host doesnt allow this, if that is possible, but then i thought again that it would display the losing box. here is my code. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] <?php $auth = false; // Assume user is not authenticated if (isset( $PHP_AUTH_USER ) && isset($PHP_AUTH_PW)) { // Connect to MySQL mysql_connect( 'db1.awardspace.co.uk', 'tkd1987_aaron', 'raymond' ) or die ( 'Unable to connect to server.' ); // Select database on MySQL server mysql_select_db( 'tkd1987_aaron' ) or die ( 'Unable to select database.' ); // Formulate the query $sql = "SELECT * FROM users WHERE username = '$PHP_AUTH_USER' AND password = '$PHP_AUTH_PW'"; // Execute the query and put results in $result $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); // Get number of rows in $result. $num = mysql_numrows( $result ); if ( $num != 0 ) { // A matching row was found - the user is authenticated. $auth = true; } } if ( ! $auth ) { header( 'WWW-Authenticate: Basic realm="Private"' ); header( 'HTTP/1.0 401 Unauthorized' ); echo 'Authorization Required.'; exit; } else { echo '<P>You are authorized!</P>'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> <meta name="generator" content="Adobe GoLive"> <title>Untitled Page</title> </head> <body bgcolor="#ffffff"> <p>Login Successful:</p> <p></p> <p></p> </body> </html>[/quote]
  4. [!--quoteo(post=356475:date=Mar 19 2006, 08:09 PM:name=blazing_bruce)--][div class=\'quotetop\']QUOTE(blazing_bruce @ Mar 19 2006, 08:09 PM) [snapback]356475[/snapback][/div][div class=\'quotemain\'][!--quotec--] hello, mysql_pconnect(); function for connecting mysql server. if you are using a simple database on your website then use mysql_connect(); it is enough. Thank you, Karthi keyan. [/quote] thanks but i have tried that too and i still get the same error!!
  5. [!--quoteo(post=356448:date=Mar 19 2006, 06:51 PM:name=JohneeMac)--][div class=\'quotetop\']QUOTE(JohneeMac @ Mar 19 2006, 06:51 PM) [snapback]356448[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi there. How do i get checkbox values sent to my email account? I have other variables that send fine like name, email etc and the mail () function works fine. I would like to get checkboxes working though. I have 6 activities such as quad biking, off road driving etc and how can i send these names if selected to my email account? Thanks for your time. [/quote] This probs sounds really basic but do you have the values set fot the checkboxes?
  6. Hi all, i really aint got a clue what is going on, i have used this code a hundred times before but i don't think it likes my new host. [a href=\"http://aaron.awardspace.co.uk/home.php\" target=\"_blank\"]an example is here [/a] i get this error message everything time: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/aaron.awardspace.co.uk/db_connect.php on line 10 Couldn't connect to server.[/quote] and here is my simple to use code: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<? //mysql $host = "localhost"; $username = "username"; $password = "password"; $database_name = "tkd1987_aaron"; //databsae connection. $connection = mysql_pconnect("$host","$username","$password") or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); ?>[/quote] Sorry for being a pain if this is just some stupid reading error. but thanks in advance anyway. Aaron
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.