#!/usr/bin/perl # Si lees esto, toma en cuenta que tenia solo un par de horas! use DBD::mysql; use utf8; use CGI::Carp qw(fatalsToBrowser); # Protegido por Panchosoft :) my $root_dir = "xxxx"; my $server = "xxxx"; my $user = "xxx"; my $pass = "xxx"; my $db = "xxx"; my $dbi = DBI->connect( "DBI:mysql:$db:$server", $user, $pass, { AutoCommit => 1, PrintError => 0 } ) or die "Cannot connect - " . DBI->errstr; sub populateQueryFields { %queryString = (); my $tmpStr = $ENV{ "QUERY_STRING" }; @parts = split( /\&/, $tmpStr ); foreach $part (@parts) { ( $name, $value ) = split( /\=/, $part ); $queryString{ "$name" } = $value; } } sub populatePostFields { %postFields = (); read( STDIN, $tmpStr, $ENV{ "CONTENT_LENGTH" } ); @parts = split( /\&/, $tmpStr ); foreach $part (@parts) { ( $name, $value ) = split( /\=/, $part ); $value =~ ( s/%23/\#/g ); $value =~ ( s/%2F/\//g ); $postFields{ "$name" } = $value; } } populateQueryFields(); populatePostFields(); print "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n"; print "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"; print "Pragma: no-cache\r\n"; print "Content-type: text/html\n\n"; print "
If there was more time
I'd write a poem or two more

If there was more time
I'd watch the dawn every day

If there was more time
I'd hug more people

If there was more time
I wouldn't miss anyone I love

If there was more time
I would have got to know you more.



When there's more time
I'll learn from all my mistakes

When there's more time
I'll eat breakfast every day

When there's more time
I'll dance wild in every way

When there's more time
I will be with you all

When there's more time
I will still think of you.



Too little time
For all the things I want to do

Too little time
To laugh and to boo

Too little time
To fit this big world in

Too little time
To spend it all blue

Too little time
Of seeing the light in you



This time
I will learn

This time
I will grow

This time
I will know

This time
I will fly

This time
We'll touch the sky


© Petra Creffield 2006
"; exit; print < Marioly's Blog
EHTML $id = int($queryString{"id"}); $where = $id > 0 ? "WHERE pl_posts.id = $id" : ""; $query = "SELECT pl_posts.*, COUNT(pl_comments.id) AS comments FROM pl_posts LEFT JOIN pl_comments ON pl_comments.entry = pl_posts.id $where GROUP BY pl_posts.id ORDER BY pl_posts.id DESC"; $query_handle = $dbi->prepare($query); $query_handle->execute() or die "Query error " . DBI->errstr; $query_handle->bind_columns(undef, \$id, \$title, \$message, \$created, \$comments); while($query_handle->fetch()) { my $post_id = $id; if ($id == 7) { next; } print "

$title

Escrito por marioly $created

$message

"; $query_com = $dbi->prepare("SELECT * FROM pl_comments WHERE entry = " . $post_id . " ORDER BY id ASC"); $query_com->execute() or die "Query error " . DBI->errstr; $query_com->bind_columns(undef, \$id, \$name, \$website, \$entry, \$comment, \$created_com); print "
"; while($query_com->fetch()) { $comment =~ s/\n/
\n/g; utf8::decode($comment); print "
\@$name
$comment
"; } print "

Agregar un comentario


Nombre

Website

Comentario


Enviar comentario
"; } print < function saveComment(n) { var nForm = \$("nForm_" + n); if( checkInputs(n) ) { if( nForm.elements["comment"].disabled == false ) { nForm.set('send', {url: 'addcomment.pl', method: 'post', onComplete: function(responseHTML, responseXML) { \$("comments_" + n).innerHTML = responseHTML; } }); nForm.send(); nForm.elements["comment"].disabled = true; } } } function checkInputs(n) { var nForm = \$("nForm_" + n); var correct = true; for( var i = 0; i < nForm.elements.length; i++) { var el = \$(nForm.elements[i]); if( el.type.match(/text/) ) { if( el.value.length < 3 ) { correct = false; el.removeClass("correctinput").addClass("errorinput"); } else { el.removeClass("errorinput").addClass("correctinput"); } } } return correct; } function showCm(n) { var el = \$("dvcom_" + n); var mSlide = new Fx.Slide(el); mSlide.hide(); el.style.display = ""; mSlide.slideIn(); }
FHTML