Jump to content

mpharo

Members
  • Posts

    221
  • Joined

  • Last visited

    Never

Everything posted by mpharo

  1. yes but you would then need to explode each index in the array and then implode them into a seperate variable...which is much more work...
  2. my mistake I forgot about the single quotes in the index...
  3. it might be easier to do a loop if you are using numeric index's....you would set it up to loop until a file exists then use that filename.
  4. that code there wont work because $arr does not have an index... you need to specify an array index for the extension you want... you would then need to search if the file exists and then use that array index.. if (file_exists('/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype1]')){ $file = '/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype1]'; } Else If (file_exists('/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype2]')){ $file = '/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype2]'; } Else If (file_exists('/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype3]')){ $file = '/home/lordofth/public_html/images/players/m'.$player[id].'.$arr[imagetype3]'; } this is untested but you can get the jist of it...
  5. Well for one you spelled college wrong... $_POST['colledge'] Also you do not need the {} in each of the post variables... I also assume you are putting in a password in your mysql_connect(); function...
  6. We really need to see the code to be of any help...
  7. use javascript to get the date/time from the client, then you dont need to worry about what time zone theyre in.
  8. If you wrap it in a <form> you can validate it by checking if $_POST['t_id'] is intialized or not...
  9. did you register the extensions dir as a environement variable?
  10. the way to do it is check for a active game then print the resulting tables. <table> <tr> <td> <?php If ($activegames>=1){ echo "<table>" . "<tr>" . "<td>" . "Table 1" . "</td>" . "</tr>" . "</table>" . "</td>"; } If ($activegames>=2){ echo "<td>" . "<table>" . "<tr>" . "<td>" . "Table 2" . "</td>" . "</tr>" . "</table>" . "</td>" . "</tr>"; } </table> ?> ect...ect...ect...
  11. One way to do this is through embedded tables... <table> <tr> <td> <table> <tr> <td> Table 1 </td> </tr> </table> </td> <td> <table> <tr> <td> Table 2 </td> </tr> </table> </td> </tr> <tr> <td> <table> <tr> <td> Table 3 </td> </tr> </table> </td> <td> <table> <tr> <td> Table 4 </td> </tr> </table> </td> </tr> </table>
  12. I am not sure what Web Server your using but here is a good howto on how to do it with Apache. http://www.apacheweek.com/features/userauth This must be done at the web server level.
  13. add an echo in your if statement and see if you get output, if you dont then your if statement isnt being validated.
  14. Is there a reason why your using a flat file instead of a database? I am assuming you want something like this... <html> <head><title>911 Dispatch Logs</title></head> <body bgcolor="#002233" text=white> <H1>911 Dispatch Logs </H1> <?php // This is a form with "sticky" fields ..... ?> <form method=post> <input type="hidden" name="posted" value="true"> <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="2" WIDTH="50%"> <TR> <TD>Department:</TD> <TD><select name=one> <?php $compass = array ("Center Point","Birmingham","Trussville","Fultondale") ; foreach ($compass as $possibility) { echo ("<option"); if ($HTTP_POST_VARS["one"] == $possibility) echo (" selected"); echo (">$possibility"); } ?></select></TD> </TR> <TR> <TD>Received:</TD> <TD><input name=two size=60 maxlength=100 value="<?php date_default_timezone_set('UTC'); echo date(DATE_RFC822);?>"<?php echo (htmlspecialchars(stripslashes($HTTP_POST_VARS["two"]))); ?>" size=15></TD> </TR> <TR> <TD>Type of Call:</TD> <TD><input name=three size=60 maxlength=100 value="<?php echo (htmlspecialchars(stripslashes($HTTP_POST_VARS["three"]))); ?>" size=15></TD> </TR> <TR> <TD>Location:</TD> <TD><input name=four size=60 maxlength=100 value="<?php echo (htmlspecialchars(stripslashes($HTTP_POST_VARS["four"]))); ?>" size=15></TD> </TR> <TR> <TD>Unit(s):</TD> <TD><input name=five size=60 maxlength=100 value="<?php echo (htmlspecialchars(stripslashes($HTTP_POST_VARS["five"]))); ?>" size=15></TD> </TR> <TR> <TD>Details:</TD> <TD><input name=six size=60 maxlength=100 value="<?php echo (htmlspecialchars(stripslashes($HTTP_POST_VARS["six"]))); ?>" size=15></TD> </TR> </TABLE> </select> <input type="Submit" value="Submit"> <input type="Reset" value="Clear"> </form> <?php // Save all the fields on any previous form to a file If ($_POST['posted']) { $fh = fopen("../data","a"); fputs($fh, $HTTP_POST_VARS["one"]." | ". $HTTP_POST_VARS["two"]." | ". $HTTP_POST_VARS["three"]." | ". $HTTP_POST_VARS["four"]." | ". $HTTP_POST_VARS["five"]." | ". $HTTP_POST_VARS["six"]." | ". "\n"); fclose($fh); } // Echo the file contents onto the end of the form ?> <FONT style="BACKGROUND-COLOR: #808080" COLOR=white><b> <?php $stuff = implode("",file("../data")); echo (nl2br(htmlspecialchars(stripslashes($stuff)))); ?></b> </FONT> </body> </html>
  15. There is a great open source project called Smokeping http://oss.oetiker.ch/smokeping/ It uses functions like echoping to actually bring up a web page at a set interval to check for up or downtime. You can also set up e-mail notifications for a certain threashold.
  16. also be sure your PHP syntax is proper, I see 2 errors just at a glance.... if(!query) echo "no data found"; and... if(!insert_img) echo "didn't insert images";
  17. Can i also see your login script/form? I now fully understand what your issue is...one way of doing it is to make this into a seperate file and include it, then in your news.php file you check for the variable passed and if it is not passed then you include the same file but do not echo the results you would want from index.php, you can do that by checking what file it is included in with the $_SERVER['PHP_SELF'] global variable.
  18. It most certainly can, just like any other variable. You use the unset($_SESSION['id']); function and then reset it like you had originally done. $_SESSION['id']=$id;
  19. It will work just as intended. You just need to set your session variables at the first instance the id appears, which sounds like index.php, then no matter what page they goto it is already set in a variable that you can use to print the result. So in index.php you create a session variable that is the output for the link, based on your query, you will never have to query again for that session to get the result because it is stored in a variable that you can print on any page.
  20. You would do it on the page, so if someone went to index.php you would do: <?php session_start(); $_SESSION['id']=$link; echo "$_SESSION['id']"; ?> Then for like news.php: <?php session_start(); echo "$_SESSION['id']"; ?> This will both echo the same result of the link, so you will just need to populate the session variable with the same thing that you want the link to contain.
  21. You create session variables for all of your $id's that you want displayed that are dynamic. So a person logs in and visits the news page, the session variables are set, and no matter what page they goto forward or back the session is already started to it will stay the same.
  22. You can use a session variable, so that when someone logs in you set the session variable to what you want then when a person logs off you unset the session variable or when they close the browser. http://us.php.net/session
  23. that code right there and the one you PM'd works perfect for me...can we see your connect string? just do not post the username/password for your DB...
  24. theres gotta be something else in your code causing it not to work because it is working perfect for me with that code...
  25. I did mention that wayy back in my first post...
×
×
  • 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.