Jump to content

i need help with a long list of php features/codes


deathadder

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.