View Full Version : Optional fields in a perl script...
master_debator
04-17-2007, 09:05 AM
Whats going on everyone. My buddy is writing a perl script that we will be using to compile a database of political profiles on myspace and stored in a flat file (either html or a text file). He had found a script that he is currently working on modifying it to match our needs. The script will take data from a form that will have the following fields:
1) friendID (myspace uses these to identify profiles) - mandatory
2) Name/profile name - mandatory
3) Location - optional
What were wondering is, how can we make the third option (location) optional? We both are relatively newbies at this kind of thing.
FishMonger
04-17-2007, 05:05 PM
Optional where...in the html form or in the flat file that you're storing the data?
Show us your code so we can help show how to output your data.
master_debator
04-17-2007, 05:58 PM
Optional where...in the html form or in the flat file that you're storing the data?
Show us your code so we can help show how to output your data.
Optional as in the entry portion of the html form. Basically, not everyone is going to want to put their location, so that will have to be optional.
Thanks
Oh, and about the code, I'll post it here, or in a pm to you, as my buddy has it on his computer, and he's away from the computer right now.
FishMonger
04-17-2007, 06:22 PM
Optional as in the entry portion of the html form. Basically, not everyone is going to want to put their location, so that will have to be optional.That's simple, just don't apply any javascript validation to that field.
It would be better to post your code here rather than in a PM, so that others can provide assistance.
master_debator
04-17-2007, 07:01 PM
That's simple, just don't apply any javascript validation to that field.
It would be better to post your code here rather than in a PM, so that others can provide assistance.
Dammit. I tried to post the code in here, but its to big. If you go to www.myspace.com/emergeunited_movies and scroll down, you will see the submit form that I am going to be working with. There will only be 3 variables that will be used (2 required and one optional). FRIENDID = the persons individual myspace id (34343543 for example), NAME, LOCATION. If you want, I can email the script that we are trying to work with, and see if you can possibly help us.
The format that we need the links to be written to the flat file (either html or txt) is in the following format.
<a href = "http://profile.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&friendid=FRIENDID">NAME, LOCATION</a><br>
I'm sure that this has to be relatively simple, but I've got no idea how to do this, and when looking at the code, I just way to overwhelmed.
I want to get this thing up and running as quick as possible, as we will be using this to network as many of the political people on myspace that we can find.
If anyone can help me, just hit me up here or send an email to con_brew_and_view@hotmail.com
FishMonger
04-17-2007, 07:27 PM
You can either post the section of the script that you need help with, or attach the complete script as a .txt file and specify the section (line numbers). If you can't narrow down the problem section, then there is not much that we can do to help short of doing a complete debug of the script which is out of the question.
master_debator
04-17-2007, 09:02 PM
You can either post the section of the script that you need help with, or attach the complete script as a .txt file and specify the section (line numbers). If you can't narrow down the problem section, then there is not much that we can do to help short of doing a complete debug of the script which is out of the question.
Ok, I think I'm going to try to do this whole thing myself, as the code is very effin large. So far, this is the html code that I have to display the form on my buddies website.
The variables that I have are friend_id$, name$ and location$. I need to make friend_id$ and name$ both required, and location$ optional. I'm sure it will be a relatively simple script to write, but I really need some help, as I'm totally lost with this. Can anyone help me with this code (may have to be from bottom up, as I'm totally new at this)?
I can be reached via hotmail @ con_brew_and_view@hotmail.com or you can send me a message to me on either aim or yahoo messenger via my screen name of anst0ni0 (zeroes).
The flat file will have links in this format.
<a href = "http://profile.myspace.com/index.cfm?fuseaction=invite.addfriend_verify&friendid=friend_id$">name$, location$</a><br>
<div class="middle">
<br>
<center>
<table border=0 width=100% cellpadding=1 cellspacing=1 background="http://i21.photobucket.com/albums/b291/stauffer_503/6435899c.jpg " ">
<tr>
<td bgcolor=000000 width=100%>
<font size=2 color=ffffff>Join the Truth Information Network</font>
</td>
</tr>
<tr>
<td width=100%>
<center>
<br><br>
<form action="/train/addconfirm.php" method="POST">
<font size=2 color=ffffff >Input friendID:</font><br>
<input type="text" name="friend_id$" maxlength=50><br>
<font size=2 color=ffffff >Name/Profile Name</font><br>
<input type="text" name="name$" maxlength=25><br>
<font size=2 color=ffffff >Location (optional) ex - Detroit, Michigan</font><br>
<input type="text" name="location$" maxlength=25><br>
<br>
<br>
<center>
<input type="submit" value="Submit">
</center>
</form>
</td>
</tr>
</table>
</center></div><br>
</div>
</td>
</tr>
</table>
FishMonger
04-17-2007, 09:20 PM
It's hard to tell from your post, but are you needing help with the html coding or the script that processes the form?
<form action="/train/addconfirm.php" method="POST">That's pointing to a php script, not a Perl script. Which language are you using for your script?
master_debator
04-17-2007, 09:26 PM
It's hard to tell from your post, but are you needing help with the html coding or the script that processes the form?
That's pointing to a php script, not a Perl script. Which language are you using for your script?
He's writing the script in Perl. He's been trying to modify the script that we have gotten from some website. The form that I have presented here is from whoretrain.net and it used php. I'm sure I'm going to have to change the form to point to the Perl script, however that is done. Personally I think it will be much easier for us to just write the script from scratch, but I'm not sure how. We're really going to need help with this.
## Make sure the first line of the program points to the ##
## path to perl on your server. ##
## ##
## Make a directory named "linkcollector" or anything in ##
## the cgi-bin directory of your web host. ##
## ##
## Just upload the "config.cgi" & "setup.cgi" into the ##
## "cgi-bin" directory. ##
## ##
## Set permission to the setup.cgi to 0755. ##
## ##
## Upload the "lc.zip" into your HOME DIRECTORY. ##
## ##
## Run the setup.cgi script. ##
## http://www.yourdomain.name/cgi-bin/linkcollector/setup.cgi ##
## ##
## Thats all. ##
#######################################################
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.