Jump to content

[SOLVED] Quick Questions PHP


Ell20

Recommended Posts

Excellent, that fixed that and I now have the following on the page source of css

 

color: '#ffffff';

background-color: '#00CCCC';

 

Which is the correct values taken from the databse BUT the page is still displaying white and not those actual colours!!

 

Thanks

Fixed that!

I was stupid and put 'color'!

 

Its changed now  ;D

 

Last problem is that when I changed my query back to '$id' it stopped working again and when I viewed the source of CSS the values for colour and text were blank!

 

Yeah it did say body, sorry forgot to copy and paste that bit!!

index.php

<?php
if ($u && $p) {
$query = "SELECT user_id, club_id, validate FROM users WHERE username='$u' AND password=PASSWORD('$p')";
$result = @mysql_query($query);
$row = mysql_fetch_array ($result, MYSQL_NUM);

/* If they match create session */
if ($row) {
	$validate=$row[2];

	if ($validate == 1) {
		/* Redirect to main.php when logged in */
		$_SESSION['user_id']=$row[0];
		$_SESSION['club_id']=$row[1];
		header ("Location: http://" .$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "main.php");
		exit();
?>

 

session_start() is written inside header.html which is called in every page.

 

Thanks

But you still need session_start() on that page. Try putting it in at the top but under <?php of course. :D If that doesn't work, I'll check up on this later.

 

Dinnertime for me, so I'll check back later. Maybe someone else can fill in for me while I'm satisfying my tummy. :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.