<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>WebDeveloper.com - Perl/Python/Ruby</title>
		<link>http://www.webdeveloper.com/forum/</link>
		<description>Discussion and technical support for using and deploying Perl/Python/Ruby.</description>
		<language>en</language>
		<lastBuildDate>Thu, 23 May 2013 19:23:26 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.webdeveloper.com/forum/images/misc/rss.png</url>
			<title>WebDeveloper.com - Perl/Python/Ruby</title>
			<link>http://www.webdeveloper.com/forum/</link>
		</image>
		<item>
			<title>CGI Forms - Help Required</title>
			<link>http://www.webdeveloper.com/forum/showthread.php?277495-CGI-Forms-Help-Required&amp;goto=newpost</link>
			<pubDate>Mon, 06 May 2013 16:07:42 GMT</pubDate>
			<description>Hi, 
 
 
 
I am very new to all this and have recently set up a website using Webplus X5 and justhost as the web host. On the website I have included a form for clients to include their Name etc and attach a document. I have been trying to correct / change the code on the form (using CGI) for a...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
<br />
<br />
I am very new to all this and have recently set up a website using Webplus X5 and justhost as the web host. On the website I have included a form for clients to include their Name etc and attach a document. I have been trying to correct / change the code on the form (using CGI) for a while now but I cannot get it to work.<br />
<br />
Please please please could someone help me, because as I said I am new to all this and have try / read everything I can but I am totally getting confused now! I have contacted the web host provided but they don't seem to want to help.<br />
<br />
Anyway I have included the upload script and form script (plus some of the rest of the page script - if you can help and need the rest I can post it)  I have been trying to correct and would be very grateful if someone could try and direct me to how to make it work.<br />
<br />
Also any advice on where the forms / upload script should go would be welcome as I have read that if it is not put in the right place the whole thing will not work.<br />
<br />
<br />
<br />
As I said I am TOTALLY confused  with it all now and really could do with some help!<br />
<br />
<br />
Thanks<br />
<br />
<br />
Upload script<br />
<br />
#!/usr/bin/perl -wT<br />
<br />
use strict;<br />
 use CGI;<br />
 use CGI::Carp qw ( fatalsToBrowser );<br />
 use File::Basename;<br />
<br />
$CGI::POST_MAX = 1024 * 5000;<br />
 my $safe_filename_characters = &quot;a-zA-Z0-9_.-&quot;;<br />
 my $upload_dir = &quot;/uploads&quot;;<br />
<br />
my $query = new CGI;<br />
 my $filename = $query-&gt;param(&quot;DOCUMENT1&quot;);<br />
 my $email_address = $query-&gt;param(&quot;email_address&quot;);<br />
<br />
if ( !$filename )<br />
 {<br />
 print $query-&gt;header ( );<br />
 print &quot;There was a problem uploading your document (try a smaller file).&quot;;<br />
 exit;<br />
 }<br />
<br />
my ( $name, $path, $extension ) = fileparse ( $filename, '\..*' );<br />
 $filename = $name . $extension;<br />
 $filename =~ tr/ /_/;<br />
 $filename =~ s/[^$safe_filename_characters]//g;<br />
<br />
if ( $filename =~ /^([$safe_filename_characters]+)$/ )<br />
 {<br />
 $filename = $1;<br />
 }<br />
 else<br />
 {<br />
 die &quot;Filename contains invalid characters&quot;;<br />
 }<br />
<br />
my $upload_filehandle = $query-&gt;upload(&quot;DOCUMENT1&quot;);<br />
<br />
open ( UPLOADFILE, &quot;&gt;$upload_dir/$filename&quot; ) or die &quot;$!&quot;;<br />
 binmode UPLOADFILE;<br />
<br />
while ( &lt;$upload_filehandle&gt; )<br />
 {<br />
 print UPLOADFILE;<br />
 }<br />
<br />
close UPLOADFILE;<br />
<br />
print $query-&gt;header ( );<br />
 print &lt;&lt;END_HTML;<br />
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;<br />
 &lt;html lang=&quot;en&quot;&gt;<br />
 &lt;head&gt;<br />
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;<br />
&lt;meta name=&quot;Generator&quot; content=&quot;Serif WebPlus X5 (13.0.3.029)&quot;&gt;<br />
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE8&quot;&gt;<br />
 &lt;title&gt;Thanks You&lt;/title&gt;<br />
 &lt;style type=&quot;text/css&quot;&gt;<br />
 img {border: none;}<br />
 &lt;/style&gt;<br />
 &lt;/head&gt;<br />
 &lt;body&gt;<br />
 &lt;p&gt;Thanks for uploading your document&lt;/p&gt;<br />
 &lt;p&gt;Your email address: $email_address&lt;/p&gt;<br />
 &lt;p&gt;Your document:&lt;/p&gt;<br />
 &lt;p&gt;&lt;img src=&quot;/upload/$filename&quot; alt=&quot;DOCUMENT1&quot; /&gt;&lt;/p&gt;<br />
 &lt;/body&gt;<br />
 &lt;/html&gt;<br />
 END_HTML<br />
<br />
<br />
Form script<br />
<br />
    <br />
&lt;img src=&quot;wpimages/wp8ffdb634_06.png&quot; width=&quot;27&quot; height=&quot;1023&quot; border=&quot;0&quot; id=&quot;pcrv_15&quot; alt=&quot;&quot; onload=&quot;OnLoadPngFix()&quot; style=&quot;position:absolute;left:1px;top:32px;&quot;&gt;<br />
&lt;img src=&quot;wpimages/wpcb783fe0_06.png&quot; width=&quot;28&quot; height=&quot;996&quot; border=&quot;0&quot; id=&quot;pcrv_16&quot; alt=&quot;&quot; onload=&quot;OnLoadPngFix()&quot; style=&quot;position:absolute;left:771px;top:49px;&quot;&gt;<br />
&lt;div id=&quot;wp_gallery_pg_1&quot; style=&quot;position:absolute; left:34px; top:160px; width:725px; height:310px; overflow:hidden;&quot;&gt;&lt;/div&gt;<br />
&lt;img src=&quot;wpimages/wpe1308a55_05_06.jpg&quot; width=&quot;727&quot; height=&quot;31&quot; border=&quot;0&quot; id=&quot;pic_34&quot; alt=&quot;&quot; style=&quot;position:absolute;left:36px;top:1047px;&quot;&gt;<br />
&lt;img src=&quot;wpimages/wp7d8c11ab_06.png&quot; width=&quot;339&quot; height=&quot;483&quot; border=&quot;0&quot; id=&quot;qs_72&quot; alt=&quot;&quot; onload=&quot;OnLoadPngFix()&quot; style=&quot;position:absolute;left:423px;top:533px;&quot;&gt;<br />
&lt;form id=&quot;form_17&quot; name=&quot;DOCUMENT1&quot; onsubmit=&quot;return validate_form_17(this)&quot; action=&quot;/cgi-bin/upload2.cgi&quot; method=&quot;post&quot; target=&quot;_self&quot; enctype=&quot;multipart/form-data&quot; style=&quot;margin:0px;&quot;&gt;<br />
&lt;div id=&quot;txt_78&quot; style=&quot;position:absolute;left:437px;top:608px;width:125px;height:21px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;edit_19&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Company Name&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;text&quot; id=&quot;edit_19&quot; name=&quot;COMPANY&quot; value=&quot;&quot; style=&quot;position:absolute; left:559px; top:608px; width:178px;&quot;&gt;<br />
&lt;div id=&quot;txt_2&quot; style=&quot;position:absolute;left:437px;top:638px;width:87px;height:23px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;edit_1&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;First Name&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;text&quot; id=&quot;edit_1&quot; name=&quot;NAME&quot; maxlength=&quot;50&quot; value=&quot;&quot; style=&quot;position:absolute; left:559px; top:638px; width:178px;&quot;&gt;<br />
&lt;div id=&quot;txt_6&quot; style=&quot;position:absolute;left:437px;top:668px;width:78px;height:19px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;edit_4&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Surname&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;text&quot; id=&quot;edit_4&quot; name=&quot;SURNAME&quot; maxlength=&quot;50&quot; value=&quot;&quot; style=&quot;position:absolute; left:558px; top:668px; width:178px;&quot;&gt;<br />
&lt;div id=&quot;txt_1&quot; style=&quot;position:absolute;left:437px;top:699px;width:115px;height:20px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;edit_2&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Email Address&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;text&quot; id=&quot;edit_2&quot; name=&quot;EMAIL&quot; maxlength=&quot;100&quot; value=&quot;&quot; style=&quot;position:absolute; left:557px; top:698px; width:180px;&quot;&gt;<br />
&lt;div id=&quot;txt_3&quot; style=&quot;position:absolute;left:437px;top:729px;width:94px;height:21px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;edit_3&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Tel Number&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;text&quot; id=&quot;edit_3&quot; name=&quot;PHONE&quot; maxlength=&quot;20&quot; value=&quot;&quot; style=&quot;position:absolute; left:557px; top:729px; width:180px;&quot;&gt;<br />
&lt;div id=&quot;txt_79&quot; style=&quot;position:absolute;left:437px;top:761px;width:91px;height:55px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Brief &lt;/span&gt;&lt;/p&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&quot;txt_4&quot; style=&quot;position:absolute;left:437px;top:926px;width:89px;height:39px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;file_1&quot;&gt;&lt;span class=&quot;Normal-C-C2&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;pload &lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;label for=&quot;file_1&quot;&gt;&lt;span class=&quot;Normal-C-C1&quot;&gt;Document&lt;/span&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;input type=&quot;file&quot; id=&quot;file_1&quot; name=&quot;DOCUMENT&quot; size=&quot;18&quot; style=&quot;position:absolute; left:528px; top:926px; width:217px; &quot;&gt;<br />
&lt;input type=&quot;submit&quot; style=&quot;position:absolute; left:664px; top:967px; width:81px; height:22px;&quot; id=&quot;butn_1&quot; value=&quot;Submit&quot;&gt;<br />
&lt;textarea id=&quot;text_2&quot; name=&quot;COMMENT&quot; rows=&quot;9&quot; cols=&quot;20&quot; style=&quot;position:absolute; left:556px; top:760px; width:181px; height:150px;&quot;&gt;&lt;/textarea&gt;<br />
&lt;/form&gt;<br />
&lt;div id=&quot;txt_62&quot; style=&quot;position:absolute;left:516px;top:547px;width:150px;height:43px;overflow:hidden;&quot;&gt;<br />
&lt;h2 class=&quot;Wp-Heading-2-P&quot;&gt;&lt;span class=&quot;Heading-2-C&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/h2&gt;<br />
&lt;h2 class=&quot;Wp-Heading-2-P&quot;&gt;&lt;span class=&quot;Heading-2-C-C0&quot;&gt;Get a Quote&lt;/span&gt;&lt;/h2&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&quot;txt_81&quot; style=&quot;position:absolute;left:61px;top:469px;width:692px;height:61px;overflow:hidden;&quot;&gt;<br />
&lt;p class=&quot;Wp-Normal-P&quot;&gt;&lt;span class=&quot;Normal-C-C3&quot;&gt; &amp;nbsp;Welcome to First Choice Translation&lt;/span&gt;&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;script type=&quot;text/javascript&quot; src=&quot;wpscripts/jsValidation.js&quot;&gt;&lt;/script&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;&lt;/font&gt;</div>

 ]]></content:encoded>
			<category domain="http://www.webdeveloper.com/forum/forumdisplay.php?4-Perl-Python-Ruby">Perl/Python/Ruby</category>
			<dc:creator>simdunn</dc:creator>
			<guid isPermaLink="true">http://www.webdeveloper.com/forum/showthread.php?277495-CGI-Forms-Help-Required</guid>
		</item>
		<item>
			<title>Perl Login System Idea / help</title>
			<link>http://www.webdeveloper.com/forum/showthread.php?277247-Perl-Login-System-Idea-help&amp;goto=newpost</link>
			<pubDate>Thu, 02 May 2013 06:22:47 GMT</pubDate>
			<description><![CDATA[You know I'm curious, as I'm developing a site right now, I thought of an authentication process. I'll list it in steps: 
 
1. User will appear at login screen. Instead of the username and password being the traditional -username and password, it will be more so.. like walking into a patdown in an...]]></description>
			<content:encoded><![CDATA[<div>You know I'm curious, as I'm developing a site right now, I thought of an authentication process. I'll list it in steps:<br />
<br />
1. User will appear at login screen. Instead of the username and password being the traditional -username and password, it will be more so.. like walking into a patdown in an airport before going threw the scanner.<br />
2. Next perl script will execute a traditional mysql query match, and if true some random number gets generated and outputted to the user, this doesn't flag the authentication flag in the database yet though.. however a cookie is sent / a new CGI session.<br />
3. The user will then be in more so of a.. contained locked down authentication state any dynamic data that needs to be updated by the user (just data stored in database) will be accomplished here.. Once the user triggers an event that we know the user is done updating the database of information, step 4 occurs..<br />
4. The next perl script, will search for an email from user, validate the validation code, and username. If authenticated, the old cookie is destroyed and a new one is created and stored on users computer, if authentication failed the script prompts a new validation code and ask to repeate so user doesn't rage face from lossing data that they already updated (but this data was more so temporary).<br />
5. ajax will bassically load a new page for user, and they have access to my main product/functionallity.. which is actually a dynamic and static sms web content group page where other users can be assigned to a group and see people's sms updates, which are actually commands that I parse in perl when their browser consistantly request a perl script that manages the messages. Really cool, I'll show you guys the link to a small demo if you want.<br />
<br />
Now here is the catch, since their browser will request a different perl script every 5000ms to check for sms commands/updates, why not connect it to another more... logical script that destroys the user's session after 15000ms of no ajax requesting the mail processor?<br />
<br />
I can't think of how to do this programatically, setting up this session destroy when a script is not executed after 15000ms.. The only thing I can think of is printing a variable to a perl script that would flag something not to delete session, but even that I'm unsure how to tackle it.<br />
<br />
And the way my site is set up, is perfect for an operation like this to happen. This measure of secury flows in well with what the users are doing since its very specific, if that makes sense.<br />
<br />
Let me know what you guys think:)</div>

 ]]></content:encoded>
			<category domain="http://www.webdeveloper.com/forum/forumdisplay.php?4-Perl-Python-Ruby">Perl/Python/Ruby</category>
			<dc:creator>jazzmasterkc</dc:creator>
			<guid isPermaLink="true">http://www.webdeveloper.com/forum/showthread.php?277247-Perl-Login-System-Idea-help</guid>
		</item>
		<item>
			<title>Printing records in Perl</title>
			<link>http://www.webdeveloper.com/forum/showthread.php?277211-Printing-records-in-Perl&amp;goto=newpost</link>
			<pubDate>Wed, 01 May 2013 19:36:24 GMT</pubDate>
			<description><![CDATA[Let's say I have a file and there are 8 records in it. 
I would like to print the whole file 3 records at a time. 
The file will never be large (maybe a dozen or so records at most). 
 
I tried to find an answer for this, however, found everything but. 
 
 
Code: 
--------- 
use strict;]]></description>
			<content:encoded><![CDATA[<div>Let's say I have a file and there are 8 records in it.<br />
I would like to print the whole file 3 records at a time.<br />
The file will never be large (maybe a dozen or so records at most).<br />
<br />
I tried to find an answer for this, however, found everything but.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">use strict;<br />
use warnings;<br />
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);<br />
print &quot;Content-type: text/html\n\n&quot;;<br />
<br />
my $nol=&quot;3&quot;; # number of records per row<br />
<br />
while(&lt;DATA&gt;) {<br />
my $count = $.;<br />
<br />
&nbsp;my @pl =split /\|/, $_;<br />
<br />
&nbsp; print qq ~($pl[0])$pl[1] ~; # Each row is three records<br />
<br />
&nbsp;}<br />
<br />
__DATA__<br />
aaa|one<br />
bbb|two<br />
ccc|three<br />
ddd|four<br />
eee|five<br />
fff|six<br />
ggg|seven<br />
hhh|eight</code><hr />
</div> How do I make this work?<br />
<br />
Thanks in advance</div>

 ]]></content:encoded>
			<category domain="http://www.webdeveloper.com/forum/forumdisplay.php?4-Perl-Python-Ruby">Perl/Python/Ruby</category>
			<dc:creator>edatz</dc:creator>
			<guid isPermaLink="true">http://www.webdeveloper.com/forum/showthread.php?277211-Printing-records-in-Perl</guid>
		</item>
	</channel>
</rss>
