Jump to content

Locating files


ccrevcypsys

Recommended Posts

Hello i now have a question to anyone out there that is good at php and mysql.

 

Here's the query:

I need to be able to download the database files to my local host desktop from my admin page. I know the where the files are i was just wondering if this was possible. If so what is the best way to do this. This is what i have so far.

I am working off of my local host just for now until i finish the back end code. I have an if statement that should tell me that if those files exist  it will say Go Offline and if not then it will say go live.

 

 if(file_exists("C:\xampp\mysql\data\nnds\courses.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\courses.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\courses.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\events.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\events.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\events.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.MYI")){ ?><a href="index.php?dl=db">Go Offline</a><?php }else{ ?> <a href="">Go Live</a> <?php } ?></li>

But the problem is that this doesnt work how i thought it would.

see im codeing for a real idiot. She wont be able to go on phpmyadmin and download it herself (u know csv or w/e) but ne way is this possible?

Link to comment
https://forums.phpfreaks.com/topic/82200-locating-files/
Share on other sites

Hello i now have a question to anyone out there that is good at php and mysql.

 

Here's the query:

I need to be able to download the database files to my local host desktop from my admin page. I know the where the files are i was just wondering if this was possible. If so what is the best way to do this. This is what i have so far.

I am working off of my local host just for now until i finish the back end code. I have an if statement that should tell me that if those files exist  it will say Go Offline and if not then it will say go live.

 

 if(file_exists("C:\xampp\mysql\data\nnds\courses.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\courses.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\courses.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\diary.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\events.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\events.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\events.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\newsletter.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\office_address_list.MYI") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.frm") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.MYD") && 
	file_exists("C:\xampp\mysql\data\nnds\oncall.MYI")){ ?><a href="index.php?dl=db">Go Offline</a><?php }else{ ?> <a href="">Go Live</a> <?php } ?></li>

But the problem is that this doesnt work how i thought it would.

see im codeing for a real idiot. She wont be able to go on phpmyadmin and download it herself (u know csv or w/e) but ne way is this possible?

Won't work. PHP is server side.
Link to comment
https://forums.phpfreaks.com/topic/82200-locating-files/#findComment-417731
Share on other sites

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.