
IDOXLR8
Members-
Posts
31 -
Joined
-
Last visited
Everything posted by IDOXLR8
-
That's really great. I wasn't looking forward to moving again. I have been really satisfied here.. Thanks djbob!
-
If you have ever needed to copy a bunch of files or folders there is an easy way of doing this with little effort. I wrote this script to manage new account folder creation on our local intranet and it works great. I made a template folder containing all the needed files and folders and used this script when setting up a new user. Enjoy... <?php function recurse_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { recurse_copy($src . '/' . $file,$dst . '/' . $file); } else { copy($src . '/' . $file,$dst . '/' . $file); } } } closedir($dir); } ?>
-
Create a new database from information sent from a form. In this example I use an external config file with global information that is needed for proper execution. This can be changed to your settings... The Script (create_db.php): <?php include("../config.php"); $con = mysql_connect($global_dbhost,$global_dblogin, $global_dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); } $dbname = $_POST['databasename']; if (mysql_query("CREATE DATABASE $dbname",$con)) { echo "Database created"; } else { echo "Error creating database: " . mysql_error(); } mysql_close($con); ?> The config file: <?php $global_dbType = 'mysql'; $global_dbhost = 'localhost'; $global_dbname = 'your_db_name'; $global_dblogin = 'your_username'; $global_dbpass = 'your_password'; $global_encoding = 'utf-8'; $global_rows_per_page = 20; $global_pager_items = 10; ?> The form Code: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled 1</title> </head> <body> <form method="post" action="create_db.php"> <input name="databasename" type="text" style="width: 287px"><input name="Submit1" type="submit" value="submit"></form> </body> </html>
-
Help Needed for rewrite variable in config file
IDOXLR8 replied to IDOXLR8's topic in Website Management and Coding
Yes it has been slow for me for days now. I finally got it working just minutes ago... phew... This is not much different than calling a function in VB6... That's where I spend most of my time. Thanks for all the help. If anyone needs this code it's free for the taking. Glad I could be of help. Wrote a function to do whats needed... <?php //Include database connection details require_once('../config.php'); // php file example : write string variable to text file function replaceinFile($fFile, $sStr, $sRep) { $fArray = file($fFile); // Put the file into an array $fNew = array(); // Create a new array so we can output the results $fFile = fopen($fFile, "w"); // Open the file // Loop through each array index and output the value foreach ($fArray as $fArrayNum => $fArr) { $fNew[] = str_replace($sStr, $sRep, $fArr); // Replace anything in the array which matches our variables } // Loop through each new array index and output the value foreach ($fNew as $fNewNum => $nArr) { fwrite($fFile, $fNew[$fNewNum]); // Write the new data from the array } fclose($fFile); // Close the file } echo $_POST["new_sitename"]; echo '<br />'; echo $global_sitename; replaceinFile('../config.php',$global_sitename,$_POST["new_sitename"]) //replaceinFile('../config.php',"The James Boys","The James Boys2") ?> -
Help Needed for rewrite variable in config file
IDOXLR8 replied to IDOXLR8's topic in Website Management and Coding
Byron I appreciate all the help... I've googled till I can't google anymore... Ok this is getting closer, I'm working with the first 7 variables, I think an array would be the way to go. If I can get them into an array then I can just use the array to output it to the file. //get the old variables loaded first require_once('../config.php'); $global_sitename = $_POST['new_sitename']; $username = $_POST['new_username']; $password = $_POST['new_password']; $database = $_POST['new_database']; $myserver = $_POST['new_server']; $config_base_url = $_POST['new_base_url']; $config_index_page = $_POST['new_index_page']; ================ I tried this and all it did was output the word array to the screen: $newstuff = array($global_sitename=>$_POST['new_sitename'], $username=>$_POST['new_username'], $password=>$_POST['new_password']); echo $newstuff . "<br />"; I think Im going about it all wrong...you would think that this would be widely used... Joomla uses the same thing with it's framework... I found a file that I think I can use that has everything in it that I need. Take a look at it and see what you think...Thanks -
Help Needed for rewrite variable in config file
IDOXLR8 replied to IDOXLR8's topic in Website Management and Coding
Ok maybe I didn't get it right the first time...lol I know that I will have to change the write attribute "a" This is what I'm after I have a line that reads: $global_sitename="The James Boys"; and I just want to change the red part $global_sitename="The James Boys"; there are dozens of globals that I have placed in this file, now I'm writing the Admin section of the site and need a way to configure all aspects of the site not just the easy part...as in database... silly file stuff I know but I never had the need before now... Thanks Byron -
I have a config file that stores some Global constants The file sending the info has a standard form that reads the constants and submits them to the page listed below. The config file: $global_this = "thisconstant" $global_that = "thatconstant" I just need to change the constant part not the whole thing??? Any help...This is what I have and its working... Except it appends the whole string to the end of the file... Thanks Guys <?php $sitename = $_POST['sitename']; echo "<html><head><title>$sitename</title></head><body>"; echo "$sitename will be added to record on "; echo $date; echo "<br><br>"; $outputstring = "\$global_sitename=$sitename\n"; @ $fp = fopen("config.php", "a"); flock($fp, 2); if (!$fp) { echo "<p><strong> Your Addition could not be processed at this time. Please try again in a few minutes.</strong></p></body></html>"; exit; } fwrite($fp, $outputstring); flock($fp, 3); fclose($fp); echo "<center><p><b><a href=\"test.php\">Click Here to continue</a></b></p></center>"; ?>
-
Welcome To HelioHost SilverKo The server has been pretty busy sine the registrations were reopened. It might take some time. djbob explains in this post: http://www.helionet.org/index/index.php?showtopic=4206 I hope this helps...Good Luck
-
Did you setup a new database from within cPanel? I'm not sure if accessing remotely is allowed as I've never tried it from here. there are a few things that you could do though. try this: http://www.idoxlr8.com/idoxlr8/server.php get the script http://www.idoxlr8.com/idoxlr8/server.txt
-
This is epic... Great Job djbob. I hope all these guys get caught... Thanks for keeping this kind of trash away!!
-
Glad to see ya back djbob. It's 6am cst here and I noticed things running a bit slow and checked the server load. It's currently at 20.23%. I guess this explains it. Maybe the revenue stream will open up again... btw mornin all
-
This is one way to limit the download speed of a given zip archive. limit_download_speed.txt
-
Evidently djbob still cares because we still have our free web space, but it seems he just isn't active in the forum anymore. If he would start posting more this group would be come back alive again and start generating him more money. Cheers, Byron I second that. Although we should consider ourselves lucky that we have such a good host and, all for free. This has allowed me to develop without the overhead of paid hosting.
-
If you don't push the "power button" you won't hear the "beep"
-
I'll give it go this evening. Thanks
-
Hey that's cool byron. Thanks I kinda have the same thing here at home on my dev server. quick and dirty. I'm still using the search & destroy script... although php has been behaving lately. Noticed a reboot last night. see ya
-
Since the outage yesterday, it seems that phpMyAdmin is malfunctioning. I have a database that I want to restore and it seems not to be restoring. I tried backup>restore first, it's not working either. When I try to check it I get the error from phpMyAdmin. Everything else mysql related seems to be fine. Just a heads up...Thanks
-
After many attempts at trying the av scan I finally gave up and ended up using myftpidx, a simple command line utility that scans your entire site and saves the list in a text or html file. I then searched the text file for core files. It worked great. This was really useful as my site tree is many layers deep. His site Luigi Auriemma, http://aluigi.org/mytoolz.htm the file is myftpidx 0.1.3 Maybe a weekly scan will help keep things in order... btw...were we down this morning? sat...
-
Sure, I'm interested, btw, this should be a way to test it. http://www.eicar.org/anti_virus_test_file.htm I tried his test on an old host I was on a few years ago that had a virus scan as a cpanel option and it worked then. Sorry I took so long, I've been busy as always. Here is the php antivirus zipped up (link fixed 8/14/2009) I got the original from http://www.phpantivirus.com/ I'm going to upload the test file from eicar.org and give it a try and see what happens...I'll let ya know... I gave it a try. I renamed the file to .php and scanned and it didn't find it.
-
Thanks byron...Ill give this a try, I have an antivirus scanner written in php that I use. I modified it to also look for core files. If anybody is interested, Ill zip it up for ya...
-
Last night I ftp'd into my site and noticed a bunch of core dumps there. As always I deleted them and scanned for more. Just thought I would bring this to the admins attention. I can't seem to find any more dumps but after 12 hours cPanel still reports very high disk space usage. Thanks
-
I'm hoping there is backup currently underway. The Majority of my files and database are missing. I have access web and ftp, we didn't get hacked again did we? Thanks
-
Here's a good file search script I put together. Works in any directory and will search your entire site for files matching a particular query. Type 'core' in the file form to search for any files with the word 'core' in the file name. Just give it a .php extension. http://byrondallas.heliohost.org/scripts/php/site_search.txt I can't help you there because I'm like you when it comes to dns, but if you find out what our problem is, please let us know. Cheers, Byron Thanks for the script Byron... Gonna give it a try right now and I'll get back to ya... I know dns is a bit confusing... we'll figure it out... Thanks Here's a good file search script I put together. Works in any directory and will search your entire site for files matching a particular query. Type 'core' in the file form to search for any files with the word 'core' in the file name. Just give it a .php extension. http://byrondallas.heliohost.org/scripts/php/site_search.txt I can't help you there because I'm like you when it comes to dns, but if you find out what our problem is, please let us know. Cheers, Byron Thanks for the script Byron... Gonna give it a try right now and I'll get back to ya... I know dns is a bit confusing... we'll figure it out... Thanks I guess I got all of the core files... Thanks Byron... I searched for core and then used the *. wildcard and all seems to bee "cool" I'll leave it there for today so you can take a looksee... Tomorrow the file is gone... idoxlr8.com...u know the rest... thanks again Byron... Tim
-
Thanks Byron, my site idoxlr8.com had a butt load of .core files. I was able to ftp in and delete them... not sure that I got them all tho... all seems to be working again... On another subject something seems to be wrong with the dns, possibly on this end... When using my isp's dns I can't reach helionet servers but, when I change dns to alternate(Opendns) I have no problems. It seems maybe helionet's host may not be working properly... (possibly?) I used http://www.dnsqueries.com and came up with errors. I need to learn more about the dns system. Any suggestions for a starting point? Thanks idoxlr8
-
Thanks guys. It is a rights issue. I've decided to try and start over. My database only had a little over 100 articles in it along with my Joomla Config. It shouldnt be that bad. Just time consuming. On another note... I've noticed that the server was down today. Is all well? I hope... Thanks again. Ill post back when I can see the light again... Thanks