Jump to content

Recommended Posts

hi i need the following done for my site, and i have no idea how cause i suck at php

 

i have a toplist site and i want users to only be able to vote once in 24 hrs, and i want to put a recapcha, i know i need public and private keys i have them

 

also could you please give me a snippet of the finished code instead of explaining it, i tend to learn from from editing code then reading

 

so hers the 2 vote files

 

the first one is where they type the name and click vote, 2nd performs the vote

 

first:

<center><form action="voted.php" method="post">
<table border="0" bordercolor="" style="background-color:" width="400" cellpadding="3" cellspacing="3">
<tr>
	<td>Site name:</td>
	<td><input type="text" name="title" /></td>
</tr>
</table>
<input type="submit" value="Vote" ></input></center>
</form>

 

and 2nd code:

<?php
include("config.php");

mysql_query("UPDATE sites SET votes = votes + 1
WHERE title = '$_POST[title]'");
echo "Voted!";
mysql_close($con);
?> 

 

ok i would also like a better control panel, instead of having just

site name:

password:

description:

[edit]

 

if it where possible id like to have a cpanel that has

site name:

password:

then redirects to another page where you can edit it, if you can't/wont do this for any reason i will settle for just a peie of code to say "invalid username or password" if details are incorrect so heres my code

 

<?php
include("config.php");

mysql_query("UPDATE sites SET content = '$_POST[content]'
WHERE title = '$_POST[title]' AND password = '$_POST[password]'");
mysql_query("UPDATE sites SET link = '$_POST[link]'
WHERE title = '$_POST[title]' AND password = '$_POST[password]'");
echo "Site Updated";
mysql_close($con);
?> 

 

and the html bit

<center><form action="edit.php" method="post">
<table border="0" bordercolor="" style="background-color:" width="400" cellpadding="3" cellspacing="3">
<tr>
	<td>Site name:</td>
	<td><input type="text" name="title" /></td>
</tr>
<tr>
	<td>Password:</td>
	<td><input type="password" name="password" /></td>
</tr>
	<tr>
	<td>Link to site:</td>
	<td><input type="text" name="link" /></td>
</tr>
<tr>
	<td>Description:</td>
	<td><textarea name="content" ></textarea></td>
</tr>
</table>
<input type="submit" value="Edit Site" ></input></center>
</form>
</body>
</html>

 

ok i hope you can help, ill try to make this have the best punctuation i can, and please dont tell me how insecure these codes are i have been informed plenty of times

 

you dident md5 your password.... and if your webpage is not i strongly sugest you do ...

 

as for limiting vote time .... add a time toamp to the user that is set for +24 hours and run a check if (time()=>$user['tstamp']) then let them vote

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.