Ok I am putting together another test site. The site is like a hot or not site. http://24.211.98.44/index.php
I have two problems:
I need to get a previous randomized variable from another php file.
I also need to learn how to INSERT the value of 1 to the amount of current votes.
How the site works:
Index.php file>
Includes my connect.php file (read connect.php before reading this next part)
Displays Title, $Name, $Img, $Votes, and submit button
<?php include("connect.php"); ?>
<html>
<head>
<title>Random IMGs</title>
</head>
<body>
Name: <?php echo $Name; ?><br>
Img: <img src="<?php echo $Img; ?>" width="400" height="600"><br>
Votes: <?php echo $Votes; ?><br>
<form method="post" action="addvote.php">
<input type="submit" name="Submit" value="Click this button">
</form>
</body>
</html>
Connect.php file>
This file loads my database ("test2") then to my table ("Females")
Randomizes to find one row in the database
*The states the found variables
<?php
session_start();
mysql_connect("localhost","root","") or die("e1");
mysql_select_db("test2") or die("e2");
$result = mysql_query("select * from females order by rand() limit 1") or die("e3");
while($row = mysql_fetch_array($result))
{
$Name = $row['Name'];
$Img = $row['Img'];
$Votes = $row['Votes'];
}
?>
Addvote.php file>
This is one of the codes i need
I need to INSERT +1 vote to the previously started $votes value
What i have so far:
<?php
if (isset($_POST['submit']))
{
}
?>