pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
Not enough to even matter or notice, so it really doesn't matter.
-
Thats still going to return an error, it should be this: <?php $strHTML = "<form method='post' action='".$PHP_SELF."?action=save'>n" ."Item Description: <input type='text' name='desc' id='desc' value='".$row['itemDes']."' /><br />n" ."Status: <input type='text' name='status' id='status' value='".$row['Status']."' /><br />n" ."<input type='hidden' name='record_id' id='record_id' value='".$record_id."' />n" ."<input type='submit' value='Save' />n" ."</form>n"; ?>
-
<?php $borrowed_date = "2008-02-01"; $due_date = date("Y-m-d", strtotime($borrowed_date . "+ 14 DAY")); echo "The book is due back on <b>$due_date</b>"; ?>
-
First, change your form to this <form action="<?=$PHP_SELF?>" method="post" name="signup"> <p>First Name:<br /> <input name="f_name" type="text" maxlength="20" /></p> <p>Last Name:<br /> <input name="l_name" type="text" maxlength="20" /></p> <p>Email:<br /> <input name="email" type="text" maxlength="150" /></p> <p>Username:<br /> <input name="username" type="text" maxlength="20" /></p> <p>Password:<br /> <input name="password1" type="password" size="20" /></p> <p>Retype Password:<br /> <input name="password2" type="password" size="20" /> </p> <input value="Create Account" type="submit" name="submit"/> </form> I took out the hidden input named "sending" and gave the submit button a name. Now change this line if ($sending == "yes"){ To if (isset($_POST['submit'])){ Then you should be set
-
Yes it is. We could supply you all the code, but then you wouldn't learn anything and you would just have even more questions. So I suggest you go to one of the following websites and start reading the tutorials: www.tizag.com www.w3schools.com
-
You need to setup a cron job. You can usually do this from your hosts control panel.
-
I don't know exactly why it causes an error, but you can simply wrap curly braces around the variable to avoid it. echo "rose costs {$flower_shop['rose']}, daisy costs {$flower_shop['daisy']}, and orchid costs {$flower_shop['orchid']}.";
-
You do something called "pagination". Google "PHP pagination tutorial" and you should get plenty of results.
-
This is such a common question there is a topic specifically for it that explains how to do it. http://www.phpfreaks.com/forums/index.php/topic,95426.0.html
-
Just use SUM. SELECT SUM(pay_amount) as total FROM table
-
Echo out the variables $ratings['total'] and $ratings['votes'] to make sure they are coming out as expected.
-
Can you post more of your code?
-
I rated it a 4 and the output was "Rated 0 from 1 people"
-
There is a bug in the PHPfreaks pagination tutorial, here is a revised version of the tutorial <?php $limit = 10; $query_count = "SELECT count(*) FROM table"; $result_count = mysql_query($query_count) or die("Error: " . mysql_error()); $totalrows = mysql_result($result_count, 0, 0); $numofpages = ceil($totalrows/$limit); if (isset($_GET['page'])) $page = $_GET['page']; else $page = 1; $offset = ($page - 1) * $limit; $query = "SELECT * FROM table LIMIT $offset, $limit"; echo $query .'<br>'; $result = mysql_query($query) or die("Error: " . mysql_error()); //Exit if no records to display if (mysql_num_rows($result) == 0) { exit("Nothing to Display!"); } while ($row = mysql_fetch_array($result)) { echo $row['col']."</br>"; } //Enable the Prev link if not first page if ($page > 1) { echo("<a href=\"index.php?page=".($page-1)."\">PREV</a> "); } else { echo("PREV "); } //Create links for each page in report for ($i=1; $i<=$numofpages; $i++) { if ($i == $page) { echo "$i "; } else { echo "<a href=\"index.php?page=$i\">$i</a> "; } } //Enable the Next link if not last page if ($page < $numofpages) { echo("<a href=\"index.php?page=".($page+1)."\">NEXT</a>"); } else { echo("NEXT"); } ?>
-
Try this: <?php if ($rating['votes'] == 0){ $current = 0; } else { $current = $ratings[total] / $ratings[votes]; }
-
Every field that is a primary keys means it can never have the same value more than once. Are you positive that your not duplicating the primary key in that table?
-
<?php if (isset($_POST['check'])){ //The checkbox was checked, update the database $query = mysql_query("UPDATE table SET field=1 WHERE fieldID='$some_var'")or die(mysql_error()); } ?> <form> <input type="checkbox" name="check"> <input type="submit" name="submit"> </form>
-
On this line, one of the variables is equal to 0. That is where your division by 0 error is coming from. $current = $ratings[total] / $ratings[votes]; You need to make an if statement checking if those variables are equal to 0, and if they are you already know the rating should be 0 by default. As for your links Echo "<a href=".$_SERVER['PHP_SELF']."?mode=vote&voted=1&id=".$ratings[id].">1</a> | "; Shouldn't the $rating[id] variable be changed to $_GET['id']?
-
Try changing your while loop to this <?php while($game=mysql_fetch_array($gamequery)){ if (isset($_POST['result_game'])){ if ($_POST['result_game'] == $game['game_image']) $select = "selected='selected'"; else $select = ""; } else { $select = ""; } echo "<option value='{$game['game_image']}' $select\>".stripslashes($game['game_name'])."</option>\n"; } ?>
-
Source: http://www.tech-faq.com/wamp.shtml So I guess you can
-
There is no such thing as an "invalid opinion". An opinion is simply your take on a subject. If opinions had to be backed up by facts, would there really be such thing as an opinion?
-
I second that. Same one I have and never had any issues with it.
-
I'm not sure about that one, it sure makes it sound like someone else could...so I would guess it may be possible, although I have no idea what so ever how, hah.
-
I think you need to go and change the password. Just do this by going to http://localhost and there should be a WAMP homepage where you can access and change all the information.
-
Do you have a die statement at the end of your connection to catch the mysql_error?