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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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