Jump to content

dweeber

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://cumulus.tnetweather.com

Profile Information

  • Gender
    Male
  • Location
    Mesa AZ

dweeber's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. First, <select> doesn't use selected. You normally identify what is selected by making that the first entry. You are better off collecting all of the values into an array so you can then use that to find what you need. Untested... <?php ... $result = mysql_query("SELECT goauld FROM users WHERE monitor ='mod' ORDER BY id DESC") or die(mysql_error()); $mods = array(); while($raw = mysql_fetch_array( $result )) { $mods[] = $raw; } echo '<div class="containerc"><div class="search"> <form method="post" > <select name="name_list" class="textbox" id="name_list">'; // First output the mod if they are in the post value and found in the data foreach($mods as $key => $value) { if ($value['goauld'] == $_POST['name_list'] ) { echo '<option value="' . $value['goauld'] . '"> ' . $value['goauld'] . '</options>'; } } // Next list the rest of them omitting the selected selected one foreach($mods as $key => $value) { if ($value['goauld'] != $_POST['name_list'] ) { echo '<option value="' . $value['goauld'] . '"> ' . $value['goauld'] . '</options>'; } } echo '</select> <input type="submit" name="remove" id="remove" value="Remove"> </form>';
  2. http://php.net/manual/en/function.filesize.php or http://php.net/manual/en/function.stat.php Does file exist: http://php.net/manual/en/function.file-exists.php Search through a directory: http://php.net/manual/en/function.readdir.php # $A = "BOB"; # $A .= ".v"; # echo $A; BOB.v
  3. The SID is the Session ID. You are most likely using session variables. See: http://php.net/manual/en/function.session-start.php
  4. You are not really showing where in your code you are calling the sendmail function. You did include at the top of your sendmail script: sendmail('tester','tester','test','test'); But that isn't going to do anything. Is that really in your code, or did you just change all the inputs to tester? You are also not testing for a result as to if it was accepted or not. So if the mail function is failing, your code would not know it.
  5. Not enough info to answer that. Depends on how your web host allows you to configure cron entries. Could be anything from a simple Cpanel like interface to regular raw Unix cron formatted setup. Chances are, your Web host has a FAQ on how to do it for their servers or a knowledge-base with that info.
  6. If your web host allows you to use Cron yes. You can schedule either a call to the PHP CLI to execute your code, or use something like Curl or Wget to execute the PHP code you want.
  7. You can't make that assumption. Without looking at the script and seeing what it does, nobody can.
  8. Find a friend with a Unix/Linux server with cron that can do it for you. File: cron.php <?php if(isset($_GET['c']) && $_GET['c'] == "292081") { // Insert page you want to call or do the function here } ?> http://www.somepage.somewhere/cron.php?c=292081 The code or in this case c is just to keep from some random hit from triggering it.
  9. I have the same issue for some weather related sites where I use a hit a minute to collect data that has been saved on the site but needs to be added to a running log. For me it was an easy solution as I have cron. For others however, it wasn't because the use a cheap inexpensive ($10 year) web host which don't allow cron at all. Other sites only have 1/2 hour or hour increments. The solutions I came up with were. 1) I can schedule a job on my site which has cron to call their site (a page called cron.php). It uses a code in the call so that other hits to that page don't do anything. 2) Setup a schedule on a winbox which does basically the same thing. You can do this with some simple vb scripts and the scheduler of your workstation, but you have to keep it running. 3) Run a utility on your win box which does the same thing. Never found a free one I liked, did see some paid ones. all of them would need to keep running. Running as a service would be better.
  10. I used pseudo-cron a number of time on webhosts that don't provide cron abilities. It is fairly easy to setup and use and is driven by hits to your site. So if you have a general settings file or menu or whatnot that all your pages use when you get hits, you place a snippet in that code and hits to your site drive the cron scheduling. If there are no hits, it will play catchup for tasks that should have happened. http://ly.tnet.com/y It works good for a lot of general scheduling... but if you have to have something updated on a real regular schedule, you could setup a page that you call from your workstation via it's scheduler instead. Their are some examples out on the net.
  11. It is always a good idea to place an exit after the header command to prevent further action in the script. Header outputs the header, but does not stop the processing of the rest of the script. <?php ... // Prevent non-logged in users from issuing commands. if (! $loggedInUser) { header( "Location: /login.php"); exit; } // User is logged in, make changes requested (like delete account) If you don't, the code will continue on behind the scenes which might be a big surprise if you don't know it.
  12. Only the superuser may change the owner of a file. Your webserver is not the superuser (hopefully) Perhaps you can just chmod the file so you have permission to use it. Since the file is owned by the webserver, it can change the permissions of the file like: chmod("/somedir/somefile", 666); or whatever. As it is your server, there are many other options from the system level as well. Ref: http://php.net/manual/en/function.chown.php http://php.net/manual/en/function.chmod.php
  13. The problem is you are breaking the data into three separate unrelated arrays of data with nothing to tie them together. You would be much better processing the data sequentially and storing the found data into arrays in the order they are found. You might be able to take advantage of the comments they provide which have unique id's... <!--Fixture ID: 3470645-->
  14. I tend to use single quotes for html output... This allows me to use the double quotes for html elements without having to think about it much and place variables outside of the single quotes to get them to work properly like: <?php ... echo '<a href="/u/' . $user_info['username'] . '"> <img src="' . getUserAvatar($user_info['username']) . '" class="avatar f_left small" title="' . $user_info['display_name'] . '" alt="' . $user_info['display_name'] . '" /></a>'; ?>
  15. Keith, Actually, had not really thought of XML for some reason. The forms are pretty basic as they also have to be Accessible (ADA), but there will be sections and pages and required selection fields. .... Need to think about this a bit more. Thanks for the reply.
×
×
  • 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.