Link to home
Start Free TrialLog in
Avatar of Mlungisi Ndlela
Mlungisi NdlelaFlag for South Africa

asked on

PHP error

My php files doesn't seem to work when I upload it to an online web hosting it a search and register web but it doesn't produce any error and it doesn't do anything related to php but if I put incorrect credentials it does indicate that Access is denied.

Anyone know what the course of this, but if I upload the same website to my other free webhosting it does search.
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Probably not at all PHP related but a password protected (basic auth) folder?
Apache hosting is there some .htaccess in the folder of the PHP script?
Or is it even just file permissions?
Check with the hoster FAQ.

Bye, Olaf.
You might want to post a link to the page or a copy of your code. Could be a number of reasons why it's not working
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mlungisi Ndlela

ASKER

Thanks guys. the page is at http://www.findmesa.co.za that doesn't work but the one that is working is at http://www.mlungisi.0fees.us/findme

I've just checked the server log an I noticed that it has this error
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /home/findmesa/public_html/cnn.php:2

Open in new window

but on mlungisi.0fees.us/findme I don't have this issue but I use the same script. About entering the credentials, I meant with the correct credentials it seems as if it doesn't even do anything but when I enter wrong it does produce that error of access denied.
Here is the code I'm using
<?php
mysql_connect("localhost","myusername","xxxxxxxxxxx") or die("Could not connect");
//mysql_connect("localhost","myusername","xxxxxxxxxxx") or die("Could not connect");
mysql_select_db("findmesa_sfind") or die("Could not find database!");
$output = '';
// Collect data
if(isset($_POST['searchVal'])){
$searchq = $_POST['searchVal'];
$querrry = mysql_query("SELECT * FROM `findmesa_sfind`.`dta` WHERE tags LIKE '%$searchq%' OR name LIKE '%$searchq%' OR category LIKE '%$searchq%' OR username LIKE '%$searchq%' OR addr2 LIKE '%$searchq%' OR city LIKE '%$searchq%' OR province LIKE '%$searchq' OR country LIKE '%$searchq%' OR company LIKE '%$searchq%' LIMIT 0,10 ") or die(mysql_error());//LIMIT 0,10 order by lp
$count = mysql_num_rows($querrry);

$output = '<div style="color:#000000"><center><h1 class="mbr-section-title display-1"><SMALL>SEARCH RESULT OF <I>' .$searchq. '</I></SMALL></h1></center></div>';
$qaw = 0;
$csx = 0;
if($count == 0){
$output .= '<div><div style="color:#000000">There was no search results!</div></div>';

}else{
while($row = mysql_fetch_array($querrry))  {
	$csx += 1;
$id = $row['id'];
$company = $row['company'];
$desc = $row['desc'];
$tel = $row['tel'];
$cell = $row['cell'];
$email = $row['email'];
$website = $row['url'];
$city = $row['city'];
$country = $row['country'];
$listingpos = $row['lp'];
$status = $row['status'];
$imgData = $row['image'];

if($csx == 1){
	$qaw = $listingpos +1;
	$querrrya = mysql_query("UPDATE `findmesa_sfind`.`dta` SET `lp`='".$qaw."' WHERE `id`='".$id."'") or die("Could not update database");


	}

	$output .= '<div style="color:#000000"><hr /><h1><a href="http://' .$website. '">' .$company. ' ' .$csx.'</a></h1><a href="http://'.$website.'"><img class="imgl borderedbox inspace-5" src="data:image/png;base64,'.base64_encode($imgData).'" alt=""></a><p><div style="color:#000000">' .$desc. '</p> Cell No: ' .$cell. '<br /><a href="mailto:' .$email. '">' .$email. '</a> <br />' .$city.','.$country. '</div></div><p></p>';//<hr />

}


}
}
mysql_close();
echo($output);
?>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial