Search found 21 matches

by brocsman
Tue Nov 26, 2013 10:50 am
Forum: mySQL & php coding
Topic: Unknown server error
Replies: 1
Views: 559

Re: Unknown server error

Solved it. Syntax again!
by brocsman
Tue Nov 26, 2013 4:55 am
Forum: mySQL & php coding
Topic: Unknown server error
Replies: 1
Views: 559

Unknown server error

I'm trying to connect to a database on a new hosting server for the first time. I'm sure I'm using the right server name, but I get an "unknown mysql server" error. Anyone got an idea how I can debug this?
by brocsman
Wed Jan 23, 2013 9:39 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

To answer your last question first, I thought I only needed to save my files as php if they contain php code. I only have one such, and it is a php file. I changed the name of the file it calls to a php file to see if it makes any difference, but no. Am I wrong about this? The code change you sugges...
by brocsman
Wed Jan 23, 2013 1:56 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Thanks. I'll try it. When I say it doesn't work in IE all that happens is that the HTML part of the files displays, the header, the menu, the footer. No message about success or failure of login, no error messages.

I'll report back this evening.

Thanks again.
by brocsman
Tue Jan 22, 2013 10:50 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

OK. I've moved it again. Is this correct? It gives me the same result - OK with Firefox and Chrome, but not with IE. <?php session_start(); // MUST be at the top of every page where you need to use sessions and be before any other code in the page ini_set('display_errors',1); error_reporting(E_ALL);...
by brocsman
Tue Jan 22, 2013 8:42 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

This is the php. I know you've made comments about my continuing to use HTML, but I'm doing things as I was taught (if that's the right word). I'm using HTML with JS on the client side (or intend to), and php for server side validation and linking to MYSql. As I said before this now logs me in using...
by brocsman
Mon Jan 21, 2013 11:59 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

I apologise for returning to the same topic, but my code now works to my satisfaction, if somewhat basically, in both Firefox and Chrome, but it is clear that in IE the session fails to start, despite valid input. I included isset(), which has removed the error messages I was getting previously, so ...
by brocsman
Sun Jan 13, 2013 12:32 pm
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Breakthrough? Hope you are still listening, and haven't given up on me yet. I'm wondering if my problem is that I'm starting a session, so the login works first time, but then I try to repeat it without ending the session, which I haven't yet learned to do. I've changed my header file, and the first...
by brocsman
Sun Jan 13, 2013 9:45 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

One more point. When I open a browser, and call the login page either from DW or from the server, with a valid username and password, the header file opens successfully. If I try again using the back button with another username it still successfully recognises that the input is valid, but it fails ...
by brocsman
Sun Jan 13, 2013 9:19 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

As I said earlier, it seems to work sometimes, but not others. I tried inserting the code you suggested, and these are the error messages I got. No idea what they mean Notice: Use of undefined constant sfg_members1 - assumed 'sfg_members1' in /hermes/waloraweb012/b688/moo.shropshirefungusgrou/loginp...
by brocsman
Sat Jan 12, 2013 8:06 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Definitely the last for today. I just tried it again with another valid login, and it failed to load the header file, so I repeated my own login, and this time it failed. Same code, no changes, different result. Maddening.
by brocsman
Sat Jan 12, 2013 8:02 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

I know it's not possible, but I've just tried it again. Haven't changed anything, and it has opened my header file correctly. I'm in a hotel with only thirty minutes wi-fi access, so I'm going to close everything very carefully, and try again at home tomorrow. Thanks for the tip about error trapping...
by brocsman
Sat Jan 12, 2013 3:44 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Thanks for your patience. I said I was new to php. I'll convert them to php files later today, and try again. Everything else works, (I originally put the echo in to make sure my username and password were being tested correctly), but not the redirect. As for error reporting, I am using Dreamweaver....
by brocsman
Fri Jan 11, 2013 1:16 pm
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Sorry - no difference!
by brocsman
Fri Jan 11, 2013 10:27 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Sorry to be a pain. I only put the echo in to test if my username and password were being picked up correctly. I've just taken it out again, with the same result. I get "Connected successfully" but the location page doesn't open. As I said earlier it did once, but then stopped. Weird.
by brocsman
Fri Jan 11, 2013 9:03 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Now I really am confused. I edited your code, and embedded it in my html file. After I realised I needed to put the session_start as the first line, it worked. Once. Stupidly I made one or two minor changes to get my css working without keeping a working version, and now it fails to load the locatio...
by brocsman
Fri Jan 11, 2013 6:00 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Thanks for the tip. I'm just starting to embed your code. Wish me luck!
by brocsman
Thu Jan 10, 2013 2:09 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

PS. Some coincidence - I live in Telford!
by brocsman
Thu Jan 10, 2013 1:57 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

Great. Thanks very much.I'll give it a try today.

Password encryption next!
by brocsman
Wed Jan 09, 2013 6:33 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Re: Login with php

I tried to introduce some code to start a session, but it didn't work, hence my question. This is the current version: <?php $uname = $_POST["user"]; $upassword = $_POST["upword"]; $link = mysql_connect('host.com', 'name', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo...
by brocsman
Wed Jan 09, 2013 4:51 am
Forum: PHP coding => General
Topic: Login with php
Replies: 32
Views: 7302

Login with php

I'm new to PHP, so be gentle with me. I'm setting up a members' area on my website. I've created the login page and a MYSql table to hold the authorised users usernames and passwords, I've drafted a php file to access the database (it works) and to validate the username and password (that works too)...