Jump to content

does not exist on this server


seivadeel

Recommended Posts

Hello.

 

I'm very new to PHP & have recently deleted then re-uploaded some material for download from my site. Unfortunately, the links from the homepage do not work & I get this message:

 

The file, Materials/The_English_Boutique-3rd Person.pdf does not exist on this server.

 

I suspect this is something easily solved in PHPMyAdmin but I don't understand how the connection is made between 'data' on PHP & folders in cpanel.

 

If anyone could talk me through what do do, I'd be very grateful.

 

Thanks in advance,

 

seivadeel

Link to comment
https://forums.phpfreaks.com/topic/39142-does-not-exist-on-this-server/
Share on other sites

First, check if the pdf file exist in the directory specified.

Then, this:

<?php
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

Is what establishes a connection between the php files and the mysql db, however, you do have to change your login name and password to your own account's.

Ted

Okay, thanks, that seems clear enough, but (and remember I am a sub-newbie here) where do I insert that piece of code amongst the code on the index page? It reads as follows:

 

<table>

<?

// check if in last 7 days

$sql = "SELECT free_data FROM freebies WHERE free_type='m' && TO_DAYS(NOW()) - TO_DAYS(free_date) <= 7 LIMIT 3";

$query = $DB->Query($sql);

$count_current = mysql_num_rows($query);

 

if ($count_current==0) {

// check for next free date

$sql = "SELECT free_data FROM freebies WHERE free_type='m' && free_date='' LIMIT 3";

$query = $DB->Query($sql);

$count_next = mysql_num_rows($query);

 

if ($count_next==0) {

// reset all dates and get first

$sql = "UPDATE freebies SET free_date='' WHERE free_type='q'";

$query = $DB->Query($sql);

 

$sql = "SELECT free_data FROM freebies WHERE free_type='q' && free_date='' LIMIT 3";

$query = $DB->Query($sql);

 

}

}

 

// update this date

$today=date("y-m-d");

 

while($array = $DB->FetchArray($query)){

extract($array);

$sql_update = "UPDATE freebies SET free_date='$today' WHERE free_data='$free_data' LIMIT 3";

$query_update = $DB->Query($sql_update);

 

$sql_data = "SELECT dt_name FROM data WHERE dt_ID='$free_data'";

$query_data = $DB->Query($sql_data);

while($array_data = $DB->FetchArray($query_data)){

extract($array_data);

$name=preg_replace('/_/', ' ', $dt_name);

echo "<tr><td style='text-align:right'>$name -</td><td><a href='download.php?m=$free_data'>download</a>";

echo " <a href='download.php?m=$free_data&view'>view</a></td></tr>";

}

}

 

?>

</table>

 

Thanks for your advice,

 

Sievadeel

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.