football123213
Oct 27 2005, 10:53 AM
| | I made this and its not very hard at all just fill in the info and it willl see if your mysql is up or down
CODE <html> <head> <title> Mysql Connection Test </title> </head> <body> <h2>
<?php // On this you need to put your host most of the times localhost username and password. $conncect = mysql_connect ( "host", "Username", "password" ) or die (" Sorry your server can't connect to your mysql server <BR> Check to see you have put in the Username and password and if this is the 1st time you have got this <BR> And it has worked before That means you need to contact your hoster and tell them my MySql server is down"); echo ("Good job your server has connected to your mysql server"); ?>
</h2> </body> <html>
Tell me what you think |
Reply
OpaQue
Oct 28 2005, 08:30 AM
The above script is not recommended as it has to connect to database to find out the error. Therefore, I would recommend the following script, which checks the server statistics and uptime. And also all other ports and reports the ones which fail. So it can check httpd, mysql, POP (mail), SSH and other ports. CODE <?php
$data .= " <style> td,body { font-family: Arial, Helvetica, sans-serif; font-size: 8pt; color: #444444; } </style> <br> <center> <div style=\"border-bottom:1px #999999 solid;width:480;\"><b> <font size='1' color='#3896CC'>Service Status</font></b> </div> </center> <br>";
//configure script $timeout = "1";
//set service checks $port[1] = "80"; $service[1] = "Apache"; $ip[1] =""; $port[2] = "21"; $service[2] = "FTP"; $ip[2] =""; $port[3] = "3306"; $service[3] = "MYSQL"; $ip[3] =""; $port[4] = "25"; $service[4] = "Email(POP3)"; $ip[4] =""; $port[5] = "143"; $service[5] = "Email(IMAP)"; $ip[5] =""; $port[6] = "2095"; $service[6] = "Webmail"; $ip[6] =""; $port[7] = "2082"; $service[7] = "Cpanel"; $ip[7] =""; $port[8] = "80"; $service[8] = "Internet Connection"; $ip[8] ="google.com"; $port[9] = "2086"; $service[9] = "WHM"; $ip[9] ="";
// // NO NEED TO EDIT BEYOND HERE // UNLESS YOU WISH TO CHANGE STYLE OF RESULTS //
//count arrays $ports = count($port); $ports = $ports + 1; $count = 1;
//beggin table for status $data .= "<table width='480' border='1' cellspacing='0' cellpadding='3' style='border-collapse:collapse' bordercolor='#333333' align='center'>";
while($count < $ports){
if($ip[$count]==""){ $ip[$count] = "localhost"; }
$fp = @fsockopen("$ip[$count]", $port[$count], $errno, $errstr, $timeout); if (!$fp) { $data .= "<tr><td>$service[$count]</td><td bgcolor='#FFC6C6'>Offline </td></tr>"; } else { $data .= "<tr><td>$service[$count]</td><td bgcolor='#D9FFB3'>Online</td></tr>"; } $count++;
}
//close table $data .= "</table>";
echo $data; $data1 .= " <br> <center> <div style=\"border-bottom:1px #999999 solid;width:480;\"><b> <font size='1' color='#3896CC'>Server Information</font></b> </div> </center><BR>";
$data1 .= "<table width='480' border='1' cellspacing='0' cellpadding='3' style='border-collapse:collapse'
bordercolor='#333333' align='center'>";
//GET SERVER LOADS $loadresult = @exec('uptime'); preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/",$loadresult,$avgs);
//GET SERVER UPTIME $uptime = explode(' up ', $loadresult); $uptime = explode(',', $uptime[1]); $uptime = $uptime[0].', '.$uptime[1];
$data1 .= "<tr><td>Server Load Averages </td><td>$avgs[1], $avgs[2], $avgs[3]</td>\n"; $data1 .= "<tr><td>Server Uptime </td><td>$uptime </td></tr>"; $data1 .= "</table>"; echo $data1;
?>
If you want to check a remote server using the above script, you will have to replace CODE $ip[$count] = "localhost"; BY CODE $ip[$count] = "IP-OF-REMOTE-HOST";
Reply
sandbox
Oct 28 2005, 09:12 AM
cool script! What does this line in an example output mean? : Server Load Averages 4.37, 3.06, 2.68
Reply
football123213
Oct 28 2005, 11:49 PM
U talking about My Script or his Because rember its not like a hard core php script is just nice and ez
Reply
sandbox
Oct 29 2005, 12:01 AM
I was talking about OpaQue's script.
Reply
Recent Queries:--
check mysql - 3.96 hr back. (1)
-
how to check mysql server - 15.48 hr back. (1)
-
check if mysql server is running - 19.04 hr back. (1)
-
importance of check table mysql - 23.55 hr back. (1)
-
mysql uptime check - 49.31 hr back. (1)
-
php ports checker uptime - 65.14 hr back. (1)
-
php check mysql status - 65.73 hr back. (1)
-
checking for mysql on a server - 68.10 hr back. (2)
-
how to check mysql server is running - 71.94 hr back. (2)
-
check mysql server status - 72.96 hr back. (1)
-
mysql check port - 84.77 hr back. (1)
-
check mysql server status os x - 84.90 hr back. (1)
-
mysql server uptime check - 92.16 hr back. (1)
-
how to check mysql port - 96.74 hr back. (1)
Similar Topics
Keywords : nice, mysql, server, check
- How To Make Your Own Counter Strike Source Dedicated Server!
(34)
Getting Started With Mysql
creating tables and insert data into them. (2) Hi in this tutorial you will learn how to create tables and insert items into them. First steps are
to create the database - go into your cpanel and mysql databases, from there make an account and a
database and then attach them together with all priviliges, call the database test and the account
admin, with the pw as pass - or any other password. We need to connect to the database so first in
your php file (probably named index.php) - this is how to do it. CODE
mysql_connect("localhost", "admin", "pass") or
die(mysql_error(&....
Nice Clean Php Layout Coding.
Learn a nice neat way to code your layouts with php (7) There are basically two main ways to code your php. Method 1) Creating a php document with an html
look. The you throw in include tags all over the place. Its unorganized, and you have lots of stray
files hidden in folders and scattered in your base directory. Its difficult to organize, and you
make mistakes easily. Example: This document would be called index.php Whatever
Banner or something Some content here. Mostly along the lines of You might ask what
the problem was? Well, those include tags tend to multiply, and so do all those unne....
How To Create Counter-strike 1.6 Server In Console Mode
(5) Hello! Now I will show you how to create a CS 1.6 Dedicated server /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> 1. Locate HLDS.exe. It
could start it from Steam. 2. Make a batch file. You could name it how you like, I writed it as
start.bat. It should be located in the same folder as the HLDS.exe. It should contain something like
this: CODE HLDS.EXE -console -game cstrike -port 27015 +maxplayers 24 +map bl_counterquake
+sv_lan 0 +rcon_password yourrconpass -secure I recommend -console to be there, couse it starts
hld....
Adding Data To A Database And Displaying It Later
Using Forms, PHP and MySQL (1) Requirements: PHP Support MySQL Database access I am going to use a news program as an example.
Ok, first you are going to need to connect to the database. Do so by using the code below. I have
added some comments where you will need to edit to fit your server's specifications. Create a
new file with notepad and call it config.php QUOTE //Change root to your database
account's username $dbusername = "root"; //Add your account's password in between the
quotations $password = " "; //Add the name of the database you are using in betw....
Simple User System
php, mysql driven (19) Hey! Maybe you've seen my other tutorials...or my signature.. Anyways I'm going to show
you how to make a system so users of your site could register accounts and you could have protected
- user only - pages on your site /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
alt="smile.gif" /> Ok, so we start by creating a config.php file. CODE <?php
$dbhost = 'database host'; $dbname = 'database name';
$dbusername = 'database username'; $dbuserpass = 'database pas....
Simple Shoutbox
PHP, MySQL driven.. (34) Ok, so I'm going to show you how to create a very basic shoutbox which is driven with PHP and a
MySQL database. So, lets start - open a database management program like PHPMyAdmin and run these
queries. SQL CREATE TABLE `shoutbox` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT
, `name` VARCHAR( 255 ) NOT NULL , `mail` VARCHAR( 255 ) NOT NULL , `time`
VARCHAR( 255 ) NOT NULL , `message` TEXT NOT NULL , `ip` VARCHAR( 255 ) NOT NULL ,
PRIMARY KEY ( `id` ) ) TYPE = MYISAM ; CREATE TABLE `shoutbox_a....
Cpanel Mysql Database Management
Part 2.1 Of My 7 Part Cpanel Tutorial (6) This tutorial is an extension to my 7 tutorial series about the Cpanel. The 7 different Cpanel
tutorials can be found below. Part 1: E-mail Management Part 2: Useful Site Management Tools
Part 3: Useful Site Management Tools2.1 Part 4: Analysis/Log Files Part 5: Advanced Tools Part
6: PreInstalled Scripts, Extras, and Cpanel Options Part 7: Fantastico Detailed Cpanel
Tutorial Part 2.1: MySQL Management In this tutorial, i will explain how to add, edit, delete
and over-all manage the MySQL Feature in the Cpanel. Creating a MySQL Database 1) ....
Starting Or Stopping Apache And Mysql Server Via Batch File
(0) Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT
(2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL
installed as Windows Services. So we can stop and start it using NET command. For more information
about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql"
and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run >
services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. ....
Check Referrer To Prevent Linking Yours From Other Sites
Check referrer with Php and Mysql (8) Check Referrer Using Php To Prevent People Linking To Your Downloads From Other Sites Ever
find that found some people are listing items, images and tuts and linking directly to the download
url (those that are like my photoshop tutorial.php?id=0), which is a .php to count the number of
downloads. To prevent this, you can add a piece of code to the download pages that checks which page
referred them to the download page: if it's my domain, it downloads the file normally, if
it's not, it will redirect to my home page instead. Important : Not all browser....
Making A Dynamic Page On Blogspot
Using an external server to make your pages hosted on blogspot dynamic (5) Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
be extremely useful if you want your visitors to contribute to your blog besides writing comments or
tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
address you specified. The address should look something like: yourusername....
Quiz With Php, But Without Mysql
(3) Ok let`s start! Once I wrote it for school: At first we need questions (php) CODE
$form_block = " <p>Quiz</p> <form method=\"POST\"
action=\"$_SERVER[PHP_SELF]\">
<p><strong>What's The Capital City Of England?</strong><br>
<input type=\"text\" name=\"q1\"
value=\"$q1\" size=30></p> <p><strong>How Many
Letters Are There In The Alphabet?</strong>&....
Installing Php + Mysql + Apache + Phpmyadmin On Windows Part 2
Continue the last section which is installing phpMyadmin (0) QUOTE phpMyAdmin lets you control you MySQL database from a web browser. Steps: 1. If you
haven't done so already, download the phpMyAdmin Database Manager - You can download the
software from the phpMyAdmin website. Be sure to download the phpMyAdmin-2.6.2-pl1.zip file. Save
the file on your Windows Desktop. ... ... ... Go to for more info. Post Copied. Member
Banned ....
Checking For Open Ports From Php
If you want to check the status of a server at a specific port you can (3) Some days ago, i needed to check ports of a server from a webpage, for advising of its status. I
simply used a great php code that's fsockopen . I'll explain it in the following example:
(Imagine a file called 'checkports.php', containing the next) CODE <? $address
=" trap17.com"; //Here you can specify the address you want to check ports $port =
"80"; //Here you can specify the port you want to check from $address $checkport =
fsockopen($address, $port, $errnum, $errstr, 2); //The ....
Searching With Php And Mysql
The easy way :P (2) Searching with PHP and MySQL is pretty easy when you think about it, especially if you're doing
it the simple way (without boolean or whatever) /tongue.gif' border='0'
style='vertical-align:middle' alt='tongue.gif' /> It consists of a few forms, a query and an
output. As I said, simple! CODE <form name=\"form1\"
id=\"form1\" method=\"post\" action=\"<?
$php_self ?>\"> <table width=\"100%\"
border=\"0\" cellspacing=\....
Run Your Own Mail / Radio Server
SHOUTcast and more (24) firstly i want to point out that i did have alot more images that i took for this tutorial but i was
only aloud to show 15 in this post /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
alt="sad.gif" /> ill ask for the ammount to be raised then i can add the rest in /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ok here we go.. Audio
Streaming Server (Radio) What is a Streaming Audio Server Its an application that will allow you to
"stream" or send a continuous block of data to a client. In a few words, it will allow....
Install Php 5 To Work With Mysql
(0) hi, all php 5 is new to all people a long time( actually, I forget how long...). it introduced a
more object-oriented design to developer. like, access type(public, private, protected), abstract
type(classes that can't create objects), interface support, and more . althrought it is
widerly available, someone still can't get it running with mysql. every time the php is starting
up. a message prompted stated that some xtensions can not be found, and therefore, not loaded. so, I
have written this to help other and newbie get it start quickly. note: thi....
Set Os X Server 10.3 Dhcp To Filter Desks
Restrict which PCs/Macs get DHCP IP #s (0) Among my other duties, I help run a small computing lab for med students at the U of MN. Recently I
learned that though we only have about twenty legitimate DHCP clients on our wired ethernet getting
addresses from our Mac OS X 10.3 Server (great system), thirty allocated DHCP addresses were being
used. Huh? I found that some addresses went to testing, which I understand, but others were being
grabbed by PCs that should have static IPs but were misconfigured and/or by outsiders who unplugged
our PCs to network personal laptops (a no-no). We don't watch our PCs all t....
Mysql Database Setup
tutorial walk through (1) Post copied. Google cache to source Credits have been adjusted. Setting Up Your MySQL &
phpMyAdmin For The First Time This tutorial will show you how to set up your MySQL and your
phpMyAdmin with ease, regardless of whether you are going to be using PHP Nuke or PHP Nuke
Platinum. The process is still the same. -Log into your CPanel with your User Name and Password.
-Click on MySQL icon -Now, we need to create a database also known as Db , Your User Name will
make up part of the necessary details, but you don't need to do this as it will be done au....
Server Status
MAke Your own server status in PHP (12) My Friend and i made an mmorpg we decided to make a code so the users could tell when the game
server was running this codoe has many other uses to like monitor a website or w/e you want to do.
CODE <? $ip = "youriphere"; $port = "yourporthere"; if
(! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>'; else{ echo
'<B><FONT COLOR=lime>Online</b></FONT>'; fclose(....
Php Dynamic Signatures
Using the GD Module and MySQL (9) PHP Dynamic Signatures using the GD Module After much scowering on the internet to find a
suitable tutorial on this subject, I came up empty-handed. So I was forced to learn it on my own
through trial & error. And since I had discovered a lack of tutorials on this subject, I dediced to
write one! Working Example: Abstract : Using the GD Module of PHP allows a
developer to build custom Images with Dynamic Content. Such content could be the Requesting Users
IP Address, Web-Browser Type, Operating System, even the number of times the user has see....
Backing Up And Restoring Mysql Databases
(10) If you're an Administrator on a Forum, you probably know the importance of regular data backups.
My Forum is always being hacked by someone and they always delete our SQL Databases. Well this
tutorial is for all of you who want to protect your data and restore it if necessary! Okay,
backing up your data is the first part. I use Cron Jobs in my cPanel to automate the backup
process. Just use this code for backing up all your SQL Databases: CODE mysqldump -u root
-psecret --all-databases > backup.sql OR if you wish to backup only a single database: ....
How To Setup Your Own Dns (domain Name Server)
(1) How To Setup Your Own Dns (Domain Name Server) This is only a quick tutorial, there are literally
hundreds of little tricks you can do with a DNS, but this will get your basics up and running.
I'm assuming you want to setup a windows DNS server, but the principals will work for most
servers. You will need.. 1) A domain name over which you have full control 2) DNS server
software(Windows server always comes with one of these) 3) At least one fixed IP address, allthough
two is highly desirable 4) An idea of what services you want on your server The first thing you ....
Checking Your Php Version
check your version of your server (1) This is a very easy tutorial, others may know of this... step 1 => Download the attachment step 2
=> upload to your public directory step3 => open and run the files and you'll get a whole list
of your server environment and so on.......
Installing And Connecting To A Ventrilo Server
(0) 1: Download The Client From http://www.ventrilo.com/download.php 2: Install The Client 3: Boot
The Client 4: Click the Arrow Pointing to the Right beside the User Name Tab. 5: Click The New
Button 6: Type In Your Desired Username And Hit Ok 7: In The Phonetic Spot, type your username
again 8: Enter A Description If Wanted and click ok 9: Click the arrow pointing to the right
beside the server tab. 10: click the new button. 11: Type in a name for the server. 12: Type in
the server address that you are connecting to in the Hostname or IP slot. 13: Click Ok. ....
Php/mysql Login/register
Tutorial for login with databases. (2) Start register code. Register.php CODE <form method=post
action=register.php?action=register name=s> <table>
<tr><td>Username:</td><td><input type=text
name=user></td></tr>
<tr><td>Email:</td><td><input type=text
name=email></td></tr>
<tr><td>Pass:</td><td><input type=password
name=pass></td></tr> <tr><td>Verify
Pass:</td><td><input ....
Complete Login And Registration System
doesn't use mysql! (9) kLogin 0.1 QUOTE(readme.txt) Readme file to kLogin 0.1 To use the internet explorer fix:
download the latest IE7 ZIP file
(http://sourceforge.net/project/showfiles.php?group_id=109983&package_id=119707) Extract the ie7
zip file to the root directory of your web server. Example, if you are using a unix/linux server,
it's on "public_html/" or "home/public_html" Open kLogin.php file with your editor and edit the
$info_text or $info_txt variable. Then, extract the kLogin.php file in to the root
directory of your web server also. Just run kShoutBo....
How To Host Ur Own Site In 2 Mins Php+mysql Needed
(34) QUOTE Run you're own server for testing phpmysql or just to host you're own website or
for you're friends. -needS: a PC that's all 8) - How to ? download : CODE
http://server.paehl.de/apache20.zip : 30 seconds Installing:---> 1 minute
*********************************** Unpack the exe where ever you want. after unpack run
serverinst.exe and change Servername and your e-mail. Start the following files one time:
start_apache.cmd --> start apache as service mysql_start_as_service.cmd --> dito for mysql
mysql_first_st....
Shoutbox, Made Easy
PHP+MySQL ShoutBox! Very simple... (17) Just create a PHP file named "kShoutBox.php" CODE <?php header("Content-type:
text/html; charset=utf-8"); //Send to browser that the charset is utf-8 ?> <?php
/* ****************************** kShoutBox 0.1 ****************************** */
/* **************************************** This ShoutBox script was created by Juan Karlo Aquino
de Guzman DO NOT MODIFY THIS CODE AND DISTRIBUTING IT WITHOUT ANY PERMISSION. E-MAIL THE AUTHOR
FIRST. Email: 01karlo@gmail.com DO NOT REMOVE THE "POWERED BY". FOR SUGG....
Complete Login System
With PHP + MYSQL (57) Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
are tryn to learn PHP. First, let's make register.php: CODE <?
include("conn.php"); // create a file with all the database connections
if($do_register){ // if the submit button were clicked if((!$name)
|| (!$email) || (!$age) || (!$login) ||
(!$password) || (!$password2)){ print "You can't let
any fields in blank....
Looking for nice, mysql, server, check
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for nice, mysql, server, check
*MORE FROM TRAP17.COM*
|
advertisement
|
|