Latest Comments

Popular / Snippets

surio commented on a Page, Random Text  -  Jun 10, 2016

http://vihuni.com i cant spin text

 Respond  
one commented on a Page, Basic PHP IRC Bot  -  May 29, 2016

what if you give this bot a kick and banning functionality and have a specific owner to use the command.

 Respond  
Lucas Lks commented on a Page, Code to redirect after successful submission of form  -  Apr 17, 2016

Thanks man. Helped me a lot. =)

 Respond  
dma commented on a Page, Basic News  -  Feb 10, 2016

wheres the script???
comments for what?

 Respond  
Elerikk commented on a Page, Uptime trigger [PITC]  -  Feb 04, 2016

I am looking for a script that triggers the bot to say something at a given time. ie at 11pm the bot would say time to go to bed joe. anyone have any ideas?

 Respond  
geekonweb commented on a Page, PHP Port Checker  -  Jan 10, 2016

Looking for a live port checker .. try this : http://www.portcheckers.com

 Respond  
dma commented on a Page, Command Line RSS Feed Monitor  -  Dec 14, 2015

whats the commnad line???

 Respond  
gzahid commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Nov 04, 2015

Hi,

I keep getting error on "Please provide a file name\n"; exit; "

Does the file name that user upload has to be "filename.csv" Also I am getting Null for $argv

I am first uploading the file to server which is loading fine, and then running this.

if(empty($errors)==true){ // start upload

            $host = 'localhost';
            $user = 'root';
            $pass = 'root';
            $database = 'db_name';

            $db = mysql_connect($host, $user, $pass);
            mysql_query("use $database", $db);

            /********************************************************************************/
            // Parameters: filename.csv table_name

            $argv = $_SERVER[argv];

            if($argv[1]) { $file = $argv[1]; }
            else {
                echo "Please provide a file name\n"; exit; 
            }
            if($argv[2]) { $table = $argv[2]; }
            else {
                $table = pathinfo($file);
                $table = $table['filename'];
            }

            /********************************************************************************/
            // Get the first row to create the column headings

            $fp = fopen($file, 'r');
            $frow = fgetcsv($fp);

            foreach($frow as $column) {
                if($columns) $columns .= ', ';
                $columns .= "`$column` varchar(250)";
            }

            $create = "create table if not exists $table ($columns);";
            mysql_query($create, $db);

            /********************************************************************************/
            // Import the data into the newly created table.

            $file = $_SERVER['PWD'].'/'.$file;
            $q = "load data infile '$file' into table $table fields terminated by ',' ignore 1 lines";
            mysql_query($q, $db);

        } // end upload

Thanks for all your help in advance.

trustedsamurai commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Oct 21, 2015

Hi Hawkee, I want to grab a csv from a geo server once a week and load it into a mySQL instance on AWS.

Would your script do this? I've tried to achieve this directly from mySQL with a LOAD DATA INFILE and always get security errors. Even though I can enter the location of the csv file into the browser url and download it fine.

dustale08 commented on a Page, CSV to mySQL - Create Table and Insert Data  -  May 06, 2015

So Should I just pop this into my Terminal?

angelxmoreno commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Nov 23, 2014

What does the $ccount variable do in the script?

shacker commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Oct 27, 2014

The issue I hit with this script is that it assumes all data in your CSV will fit into a varchar field, limited to 255 characters. But some of my data needs to go into TEXT fields with unlimited length. Unfortunately there's no way for the script to know in advance what kinds of fields to create in the db. And because the final line of the script, which does the loading, does not report errors, it fails silently (very mysterious).

CyberMage commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Jun 09, 2014

Love it - saved me some time. I had someone send me a 250 MB file with 57 tilde delimited fields that I needed to import, and PHPMyAdmin of course doesn't like big files. A couple of tweaks to your script and it worked like a charm.

 Respond  
radius314 commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Mar 29, 2014

Slight flaw in the script, as if the column name contains a reserved keyword. Say for example the word "DELETE". In this case the column variable should be wrapped in back ticks (`) to escape this.

Typo commented on a Page, Random Token Generator  -  Mar 08, 2014

I have made some serious enhancements so if you looked at this before reading this post, look again as if its new.

 Respond  
Typo commented on a Page, Random Token Generator  -  Mar 06, 2014

I had formatted the description with indenting on the examples but all the leading spaces were stripped when I posted it here. Sorry if it turns out to be a bit difficult to read.

EDIT* I will be updating this function tonight with additional functionality.

F*U*R*B*Y* commented on a Page, Basic PHP IRC Bot  -  Mar 05, 2014

chuck in a

elseif ($rawcmd[1] == "hi") { fputs($socket, "PRIVMSG ".$channel." :Your message goes here\n"); }

 Respond  
I_Is_Payton_ commented on a Page, Basic PHP IRC Bot  -  Mar 03, 2014

How would you make it say something if a user sends "Hi" in chat?

 Respond  
jo19 commented on a Page, Latest post on your homepage ( phpbb )  -  Jan 01, 2014

Thanks for the code, which works perfectly with phpbb3, but I have an issue to display the German umlaut in my website.
If applying the code I just see a � instead of the umlaut Ä, Ü or Ö.
Can sombody support what I have to put in the code to have displayed the umlaut correctly? (both database and website are in UTF-8)
Thanks in advance.

 Respond  
ryangurn commented on a Page, Capture Screenshots in PHP  -  Dec 27, 2013

The best application that i have seen for taking screen shots is a nodejs application that can easily called from php... It is called screen shot as service. This is the github for the application. https://github.com/fzaninotto/screenshot-as-a-service

 Respond  
Typo commented on a Page, [PHP] mIRC Identifier Library : mIRC.lib.php   -  Dec 18, 2013

This is pretty cool. I would never use something like this but I like that you took the time to try and do it :) .

Neat, I remember doing this stuff in my 3D programming class.

TMFKSOFT commented on a Page, Minecraft Random Item Game Plugin using rcon  -  Dec 02, 2013

Well trying it with 1.7.2 dont work pretty much. Its more a case of. Variables dont even exist.

PHP Notice: Undefined variable: done in /home/mc/vanilla/mc_items.php on line 47
PHP Notice: Undefined variable: no_mode in /home/mc/vanilla/mc_items.php on line 50

and so on :P

@Hawkee do you believe there is a way to do exactly this think with smaller code? Are there any tweeks can be made to this code? What's your opinion?\

CreativeDesign commented on a Page, "Sort by" Box for Lists  -  Nov 18, 2013

Hawkee is great ^_^

 Respond  
console commented on a Page, PHP IRC Bot v2  -  Nov 16, 2013

I get This error:

PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /BLAH/ircbot/bot.php on line 236

 Respond  
Noutrious commented on a Page, Code to redirect after successful submission of form  -  Aug 27, 2013

Not sure if this in any way is worth submitting

 Respond  
Hawkee commented on a Page, Code to redirect after successful submission of form  -  Aug 24, 2013

Please remove the link drop.

Neo139 commented on a Page, CSV to mySQL - Create Table and Insert Data  -  Aug 18, 2013

Thanks!
PHP Notice: Use of undefined constant argv - assumed 'argv' in import.php on line 14
PHP Notice: Undefined variable: columns in import.php on line 35
PHP Notice: Undefined variable: columns in import.php on line 36
to remove the last two warnings change the foreach for:
foreach($frow as $column) {
$ccount++;
if(isset($columns)) $columns .= ', ';
else $columns="";
$columns .= "$column bigint(20)";
}

Bipster commented on a Page, Latest post on your homepage ( phpbb )  -  Aug 13, 2013

All I can get to display is Could Not Connect. From what I can tell that's displayed if login fails? I am still trying to re-teach myself some of this stuff after a lengthy break in web dev. My URL path I put in the URL not referencing the folder relative to where the file is. Am I supposed to put my login and password in the code or let it call it from the config.php file?

Any help would be appreciated.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.