Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Permissions?


5 replies to this topic

#1 shredder

    Newbie

  • Kontributors
  • Pip
  • 3 posts

Posted 12 April 2006 - 11:21 AM

hi guys ive set up a db through phpadmin and and have created a php script which should connect and upload data from the db.

ive uploaded the script into my file transfer folder.

The problem being is when i run my site, i recieve this message

""You don't have permission to access / on this server."

Any ideas??

Edited by shredder, 12 April 2006 - 11:22 AM.


#2 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 12 April 2006 - 02:03 PM

Yes, somewhere in the script you are referencing a file which is stored at the root folder as indicated by the slash '/' and you do not have permission to do that on the trap17 server. Probably was okay on the local machine used to write and test the script,but the reference will have to be re-written for the trap.
Of course, I could be wrong...

#3 serverph

    Ancient Enigma

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,952 posts
  • Gender:Male
  • Location:under the stars
  • Interests:http://kapamilyatalk.com<br />http://scq.serverph.uni.cc<br />http://reseller.premium.ws<br /><br />trap17 IP to access cpanel: https://64.69.46.210:2083/<br />alternative to access cpanel: gamma.xisto.com/~cpanelusername<br />Get your T17 banners here: http://www.trap17.com/banners/<br />TRAP17 Forum Search plugin: http://plugins.astahost.com/<br /><br />[url=http://reseller.premium.ws][img]http://img40.echo.cx/img40/2713/resellerfree4rd.png[/img][/url] |
  • myCENT:67.66

Posted 12 April 2006 - 03:58 PM

check MySQL databases from your cpanel, and properly grant permissions to a valid existing MySQL user. this is mostly missed oftentimes, and unless proper permission is given to the user you have in your script configuration, you'll end up with errors of this kind. :angry:

#4 shredder

    Newbie

  • Kontributors
  • Pip
  • 3 posts

Posted 13 April 2006 - 02:07 PM

ok. heres my php script at the moment. Obviously i will need to change my username and password back when running the script.

can you see any error with the connection request??

<?php
// open connection to MySQL server
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');

// select database for use
mysql_ select_ db('db_name') or die ('Unable to select database!');

// create and execute query
$query = 'SELECT * FROM Bars';
$result = mysql_ query($ query) ~
or die ('Error in query: $query. ' . mysql_ error());


// check if records were returned
if (mysql_ num_ rows($ result) > 0)
{

// print HTML table
echo '<table width= 100% cellpadding= 10 cellspacing= 0 border= 1>';
echo
'<tr>< td>< b> ID</ b></ td>< td>< b> Name</ b></ td>< td>< b> Price</ b></ td></ tr>';
// iterate over record set
// print each field
while($ row = mysql_ fetch_ row($ result))
{
echo '<tr>';
echo '<td>' . $row[ 0] . '</td>';
echo '<td>' . $row[ 1] . '</td>';
echo '<td>' . $row[ 2] . '</td>';
echo '</tr>';
}
echo '</table>';
}
else
{
// print error message
echo 'No rows found!';
}
// once processing is complete
// free result set
mysql_ free_ result($ result);
// close connection to MySQL server
mysql_ close($ connection);
?>

Edited by shredder, 13 April 2006 - 02:07 PM.


#5 jlhaslip

    Insert Custom Title Here

  • [MODERATOR]
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,040 posts
  • Gender:Not Telling
  • Location:Linux, DOS and Windows…the good, the bad and the ugly
  • myCENT:81.07
  • Spam Patrol

Posted 13 April 2006 - 02:37 PM

Nothing to do with the problem posted, but what's with the tilde at the end of this line?
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');

And the spaces in the variable names aren't going to go well with the php parser
while($ row = mysql_ fetch_ row($ result))
$result = mysql_ query($ query) ~ // another tilde chaacter here???
if (mysql_ num_ rows($ result) > 0)


#6 shredder

    Newbie

  • Kontributors
  • Pip
  • 3 posts

Posted 13 April 2006 - 02:51 PM

View Postjlhaslip, on Apr 13 2006, 03:37 PM, said:

Nothing to do with the problem posted, but what's with the tilde at the end of this line?
$connection = mysql_ connect('localhost', 'username', 'password') ~
or die ('Unable to connect!');

And the spaces in the variable names aren't going to go well with the php parser
while($ row = mysql_ fetch_ row($ result))
$result = mysql_ query($ query) ~ // another tilde chaacter here???
if (mysql_ num_ rows($ result) > 0)

dont ask me. im just a php newbie. following a php book at the moment.




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users