Jump to content

Proletarian

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by Proletarian

  1. If you're going for percentage of time, rather than actual minutes, you might need to convert your hours into minutes, then add those to the remainer minutes, then divide it all by 60. i.e., 04h30m = 240 + 30 = 270 / 60 = 4.5 And it would be a "." not a ":" when you're displaying the hours.
  2. Where's your PHP code for the retrieving, sorting, and displaying?
  3. Check if $database_name= $_REQUEST['database_name'] is set or not.
  4. I'm guessing your FOR loop is just iterating all values in the list, which is why you're seeing all the values. But since I don't know how you're populating your block2[] array with values since it's a hidden type, I can't really tell how the values are getting into the array in the first place. I just know that if you pass an array throw POST, it should contain all the values you put into it from the form and you should be able to iterate through that array with a FOREACH loop to get at those values. Try this and tell me if it works or not (and what happens if it doesn't work). <input type='hidden' name='block2[]' value='$id' /> <input type='image' value='Block' src='delete.png' title='Block'> $data = $_POST['block2']; if($data) { foreach ($data as $id) // changed FOR to FOREACH { $sql2 = mysql_query("SELECT sender FROM nudges WHERE id = $id;"); while($r = mysql_fetch_assoc($sql2)) // changed mysql_fetch_array() to mysql_fetch_assoc { $sender=$r['sender']; echo "block $sender "; } } }
  5. I think you are overwriting your $Pzone variable every time. The logic here is not right. //this part find all pages Zone. zone is either Admin or Public $pageZone = Pages::find_all(); foreach ($pageZone as $pageZones){ $Pzone = $pageZones->zone; // <---- !!! } Also... You are using "=" instead of "==" to check for conditions. What you are doing instead is overwriting your variables you are checking. Fix those and your conditions will work correctly.
  6. www.example.com/script.php?arg1=something&arg2=somethingelse&arg3=blah arg1=something arg2=somethingelse arg3=blah Those are variables passed by the URL and retrieved via $_GET. The "?" denotes all things passed after it are variables. The "&" seperates variables from each other. With this method you can pass variables across as many scripts as you want. You can pass these variables in a FORM or you can pass them as URLs. You get the variables like this: $x = $_GET['arg1']; $y = $_GET['arg2']; $z = $_GET['arg3']; $x === "something"; $y === "somethingelse"; $z === "blah";
  7. http://php.net/manual/en/features.cookies.php
  8. I got one error so far with that. Parse error: syntax error, unexpected T_CATCH in /var/www/index.php on line 18 He forgot a closing bracket for his try block.
  9. Why don't you ask your programmers where the source is? They should know better than anyone else.
  10. require_once cannot find the file you're trying to include. Make sure that file is in the correct directory scope.
  11. I'd appreciate if you PM'ed me the links.
  12. The thing is, you're making this way more complicated than it really needs to be. If you would start putting your variables in arrays, instead of all your variables in one string, you won't need to find all your variables in that string when you need them and you can easily piece them into an output string when you do need to show them. This also means you can easily store each variable into a database via a loop so that the integrity of the data is maintained while storing, retrieving, and updating them. Your database could look like this: [ticket] - [choice 1] - [choice 2] - [choice 3] - [choice 4] - [choice 5] - [choice 6] - [choice 7] Which is easily translated into an array: ticket[choice 1] = 100 ticket[choice 2] = 200 ticket[choice 3] = etc, etc. Which is easily parsed into a string: for x { string .= ticket[x] } Which is also easily inserted and retrieved from a database: for x { insert ticket[x] into table } for x { ticket[x] = (get player.ticket[x] from table) } Try it out. You'll be amazed at how much your creativity can be focused on productivity rather than trying to reinvent the wheel.
  13. Alex Jones is as credible as the politicians he rages against.
  14. You need infrastructure to be an ISP, not just a computer. Good luck setting up your own independent telephone company.
  15. SELECT * FROM table WHERE (table.contact = criteria)? I dunno, this looks like an SQL question, not a PHP question.
  16. So out of a list of contacts, you want to select only contacts that meet a specific criteria?
  17. I'm not sure what you're trying to achieve from your vague description. Elaborate.
  18. Works for me, too. You're probably linking it wrong. By linking it wrong, I mean, href="templates/simple2-final/media/style.css" is probably incorrect somehow or the style.css file is not actually in that directory.
  19. <?php include("include/session.php"); ?> <?php if($session->logged_in){ echo "<h1>Logged In</h1>"; echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Account</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center Database</a>] "; echo "[<a href=\"etomitecomplete/admin/index.php\">Admin Center Files</a>] "; } echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> <h1>Login</h1> <?php if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr> <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>> Remember me next time <input type="hidden" name="sublogin" value="1"> <input type="submit" value="Login"></td></tr> <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr> <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr> </table> </form> <?php } ?>
  20. Oh wait, there were more MORE tags that you didn't use properly that I didn't see. Just to clarify, you know that you've been typing "<?" instead of "<?php" when you're using php, right? You know you're supposed to type "<?php" and not "<?", right? Go find ALL of your incomplete "<?" tags and replace them with "<?php" and you will stop getting all of those errors.
×
×
  • 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.