We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Creating a Poll to use on a site.; With asp or javascript
Topic Started: Apr 27 2005, 07:42 PM (679 Views)
solinent
Member Avatar
Member
[ *  *  * ]
Well since I know javascript and have little knowledge with asp, I wanna create one of my own polls so that I don't have to use another webpage to make em for me. My only problem is, is how this would be done(without php, cause php isn't enabled on my server, only asp).

I know how to write to a file with php, but have no idea how to do with asp. Anyways, if you know how please post!! :yes: :jay:
Offline Profile Quote Post Goto Top
 
Dennis
Member Avatar
Member
[ *  *  *  *  *  *  * ]
From what I know of ASP, it's not a true language, more of a combination of Javascript and vBasic.

A quick Google search for ASPM Poll came up with this. That may be useful.

P.S. No PHP? Time to go host-shopping.
Offline Profile Quote Post Goto Top
 
kingy
1 in 10 people understands binary, the other 1 doesn't
[ *  *  *  *  *  * ]
I don't think you can do that without php to be honest, as it also requires a database
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
PHP is being installed soon, and I get the host free(it's my dads servers, and he is gonna install php soon, but i wanna do it with php. :D)

(php has almost the same capabilities as asp, just asp uses VBscript.
Offline Profile Quote Post Goto Top
 
kingy
1 in 10 people understands binary, the other 1 doesn't
[ *  *  *  *  *  * ]
I am not aware of how to make databases in VBScript, so thats why i said about PHP being easiest
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
Oh, the Sql commands are the same, just VBscript functions are different. It's easy to find out how.

I think i could create a poll, Only thing left to do is to limit IPs so that one IP can only go once. How would I do this?
Offline Profile Quote Post Goto Top
 
kingy
1 in 10 people understands binary, the other 1 doesn't
[ *  *  *  *  *  * ]
Well the way i would do it, is have a 2 coloum table.

C1 - IP Address

In PHP (and i would imagin ASP) you can call the IP of the user, you could then assign this to a variable.

C2 - Vote

This would just be a number set dependant on what was voted for

The SQL thingy would just upload both of these to the database.

Then you could check for duplicates when somebody votes (unique keys etc)

Offline Profile Quote Post Goto Top
 
Sani
Member Avatar
Member
[ *  *  *  *  * ]
Google is your friend.. :P
Offline Profile Quote Post Goto Top
 
Stephen
Member Avatar
Twilight is upon me, and soon night must fall.

if you can use php, why not use seth's idiopoll script? http://sethkinast.com/work/idiopoll/
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
Can't use php, and I can get it to work now, Ive created a login system lol. I'll just have inside the database: voted?, and the value will be either yes or no. Every new poll, it'll get updated to no. When they vote it'll get updated to yes. They own't be able to vote if it is set to yes.

One more thing. I need to make it so that people cannot create multiple usernames within the same databaes.

What kind of key is that, if it is a key(primary doesn't work)

Offline Profile Quote Post Goto Top
 
kingy
1 in 10 people understands binary, the other 1 doesn't
[ *  *  *  *  *  * ]
Code:
 

$check = "select id from $table where username = '".$_POST['username']."';";
$qry = mysql_query($check)
or die ("Could not match data because ".mysql_error());
$num_rows = mysql_num_rows($qry);
if ($num_rows != 0)
{
echo "Sorry, the username $username is already taken.<br>";
echo "<a href=index.php>Try again</a>";
}
else
{
ADD THE REST OF THE REGISTER CODE HERE
}


That code checks for duplicates before creating a new account
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
NAH, I'm using asp, and since no one knows it, i'll just do it using the SQL commands.

I figured out that a primary key would work, but first the column that im setting it too has to be non nullable.

this is my sql command:
ALTER TABLE Users MODIFY username varchar(50) NOT NULL

It gives me an error, and the error says:

Incorrect syntax near 'username'

What is wrong? Thanks for the help :)
Offline Profile Quote Post Goto Top
 
Loste-ZNS
Member
[ * ]
Couldn't a poll be made on FreeWebs.com?
Offline Profile Quote Post Goto Top
 
solinent
Member Avatar
Member
[ *  *  * ]
I;m not using freeewebs, i'm using a domain and I have a host.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply