-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
try changing foreach($_POST as $id) { to foreach($_POST['display'] as $id) {
-
[SOLVED] allow access to link only if there is random numbers
DeanWhitehouse replied to irkevin's topic in PHP Coding Help
Something like? <?php if(isset($_GET['id'])) { $id = (int) $_GET['id']; echo $id; } else { header("Location:someotherpage.php"); } ?> page addi = http://yoursite.com?id=1 -
[SOLVED] Easiest question you'll ever answer (please :)
DeanWhitehouse replied to br3nn4n's topic in PHP Coding Help
That limits the amount of chars not words, you would need to mix word count and conditional statements. -
Not sure if you can get that, have you asked paypal?
-
[SOLVED] make gold decrease when people buy wood
DeanWhitehouse replied to berry05's topic in PHP Coding Help
<?php if(isset($_POST['Submit'])) { $wood += (int) $_POST['select']; $gold = $gold - ($wood / $_POST['select'] * 5);//5 gold per piece? } else { $gold = 50; $wood = 0; } ?> <p>GOLD: <?php echo $gold;?></p> <p>WOOD: <?php echo $wood;?></p> <p>BUY WOOD:</p> <p> <form id="form1" name="form1" method="post" action=""> <label> <select name="select" id="select"> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> </select> </label> </p> <label> <input type="submit" name="Submit" id="Submit" value="Submit" /> </label> </form> <p> </p> Something like that might work, but next time try your self first. -
Then save there email in a session, surely that will be fine
-
Do you know how to get information from the db? I am assuming yes, so... <?php $sql = "SELECT * FROM table_name"; $sql = mysql_query($sql); while($rows = mysql_fetch_assoc($sql)) { $headers .= 'Bcc:'. $rows['email']. "\r\n"; } ?>
-
<?php $status = ($content[4] >= 0) ? 'green' : 'red'; echo "US Oil Fund (USO)<p>$$contents[1] <img src='images/".$status."arrow.jpg'> $contents[4]; ?> Edit: beat me to it
-
I can't think of any other ways. Surely the user will already be logged in, so just check where he came from when he got to that page.
-
Use a loop.
-
Sessions or cookies then?
-
Try adding error_reporting(E_ALL); to the top of the code.
-
It would be best to use $_GET and transfer there ID if possible?
-
Learn arrays. $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' It is not closed. it should be $meals = array ( 'breakfast' => "cereal", 'lunch' => "hot dog", 'dinner' => 'hamburger' ); This should help http://djw-webdesign.awardspace.com/code.php?snippet=8
-
[SOLVED] can't start up php
DeanWhitehouse replied to Rogerconant's topic in PHP Installation and Configuration
Try restarting all services, also what colour is your wamp icon. -
[SOLVED] can't start up php
DeanWhitehouse replied to Rogerconant's topic in PHP Installation and Configuration
@ScotDiddle, try reading who started the thread -
[SOLVED] can't start up php
DeanWhitehouse replied to Rogerconant's topic in PHP Installation and Configuration
Hmm that shouldn't effect anything. It should be in one of these forums, depends on the problem. http://www.phpfreaks.com/forums/index.php?action=collapse;c=28;sa=collapse;#c28 -
[SOLVED] can't start up php
DeanWhitehouse replied to Rogerconant's topic in PHP Installation and Configuration
Wrong Forum. But have you changed any of the PHP settings since you last used it? -
Only just read what he wanted, so chill out.
-
Look at his code $username = $_SESSION['username']; $result = mysql_query("SELECT * FROM users ORDER by rep desc") or die(mysql_error()); $rank = 1; while($row = mysql_fetch_array( $result )) { $check = $row['username']; if($check == $username){ echo $rank; } $rank++; } is the same as doing <?php $username = $_SESSION['username']; $result = mysql_query("SELECT * FROM users WHERE username = '".$username."' ORDER by rep desc") or die(mysql_error()); $rank = 1; while($row = mysql_fetch_array( $result )) { echo $users['id']; } ?> I don't see why you need a separate rank.