Jump to content

Jeremysr

Members
  • Posts

    199
  • Joined

  • Last visited

    Never

About Jeremysr

  • Birthday 01/16/1992

Contact Methods

  • MSN
    jeremysr@hotmail.com
  • Website URL
    http://viewsourcecode.org

Profile Information

  • Gender
    Male
  • Location
    Saskatchewan, Canada

Jeremysr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Maybe reading it this way will help you understand it? $data['blue'] = 90; $data['white'] = 40; $data['red'] = 20; $options['width'] = 300; $options['height'] = 40; $graph = lwtMiniHorizontalBarChart($data, $options); echo $graph;
  2. PHP has an XMLReader that can be used to easily read XML. I think that would be a much better choice for this.
  3. Table names are case-sensitive, so 'usersid' is different than 'usersID'. You'll have to access the value like this: $row['usersID']
  4. Change this: $team = $_GET['team']; To this: $team = $_POST['team'];
  5. It looks like there is no `usersid` column in your table. This is why writing out all your column names that you want to select is a good idea: $query=" SELECT usersid, username, date FROM $tbl_name limit $eu, $limit "; Now if the `usersid` column doesn't exist, you'll get an error saying so.
  6. In your while loop, build a string which you will be the body of your e-mail: while($r1 = mysql_fetch_assoc($sql1)) { $pin_id = $r1['pin_id']; $pin_number = $r1['pin_number']; $email_body .= "Pin ID: $pin_id Pin Number: $pin_number"; } @mail($mail_to, $email_subject, $email_body,$from); Something like that.
  7. You can't use variables defined outside of your function inside your function, like $connection. You have to make it global like this: function read(){ global $connection; global $idstatus; mysql_query("UPDATE table SET on = '1' WHERE id = $idstatus", $connection) or die("Error querying database. Please contact the webmaster about this issue."); header('Location: example.php'); } Also you should try to use as few globals as possible. Making your $connection global might be an exception, but you'll probably want to pass your $idstatus as an argument into the function.
  8. Apparently there is no case-insensitive flag for glob() so what I would do is this: $images = array_merge(glob($directory . "*.jpg"), glob($directory . "*.JPG"));
  9. 1. I can't read the code because it's all over the place... please indent properly. 2. Use regex to validate e-mail addresses, here is a function that will return 1 if it's valid or 0 if it isn't: function is_email_valid($email) { return preg_match('/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $email); } This regex is from the homepage of http://regular-expressions.info .
  10. You could store the $_POST variables as $_SESSION variables on the first entry, and then stop using $_POST when refreshing. You'd put something like this at the top of your script: session_start(); if ($_POST) { $_SESSION['blah'] = $_POST['blah']; $_SESSION['bleh'] = $_POST['bleh']; // "Refresh" the page without POSTage. Your $_POST variables are safely stored in $_SESSION header('Location: this_page.php'); die; } $blah = $_SESSION['blah']; $bleh = $_SESSION['bleh']; // your script continues here...
  11. Jeremysr

    $dot%12

    Ok, the $dot is the number of dots that the script will display. The $opt tells the script if it's still in progress or whatever. The <META> tags will cause the page to refresh and will pass $opt and $dot in the URL: echo "<META HTTP-EQUIV=\"refresh\" content=\"10;URL=blastresult.php?jobid=$jobid&alignmentView=$alignmentView&opt=wait&dot=$dot\">"; It looks like for each page refresh, the value of $dot will be incremented by 1, which causes the nice effect of a row of twelve dots animating like this: $dot = 0: $dot = 1: . $dot = 2: .. $dot = 3: ... $dot = 4: .... $dot = 5: ..... $dot = 6: ...... $dot = 7: ....... $dot = 8: ........ $dot = 9: ......... $dot = 10: .......... $dot = 11: ........... $dot = 12: $dot = 13: . $dot = 14: .. So as $dot keeps incrementing, each page refresh will show one more dot, until it gets to 12, when the number of dots goes back to zero.
  12. Google it: http://google.com/search?q=mysql+tutorials You'll find all sorts of tutorials and documentation for MySQL. Yep, it is.
  13. It sounds like changing your MySQL query to only select "distinct" locations is what you want: $query="SELECT DISTINCT location FROM jb"; This will not give you any duplicate location fields.
  14. Jeremysr

    $dot%12

    If the URL is 'http://yoursite.com/result.php?dot=3' then $dot will have the value 3 (by getting it from $_GET['dot']). This way you could make a link to result.php and pass a number as the $dot value to it. The % is the modulus operator, as IchBin said. It returns the remainder of dividing the number on the left by the number on the right. It is useful for taking a number that could be a very large number and reduce it to a smaller range of values. For example: 0 % 12 == 0 1 % 12 == 1 2 % 12 == 2 ... 10 % 12 == 10 11 % 12 == 11 12 % 12 == 0 13 % 12 == 1 14 % 12 == 2 ... 22 % 12 == 10 23 % 12 == 11 24 % 12 == 0 As you can see, if the number on the left is less than the number on the right, the result is always the number on the left. So what that 'for' loop is doing is looping from the number zero to a number less than twelve, depending on what $dot is. It could be there to make sure that $dot is less than 12, but that wouldn't be a very good way of checking for that.
  15. I don't know too much either, but I know that it involves choosing two very large prime numbers and multiplying them together to get a very huge number. This very huge number will only have two factors, since the two numbers chosen were prime. Then something is done (mathematically) to the two factors to create a private and public key. These numbers are so huge that it would take billions of years for all the computers in the world to factor the number. (Or something like that... you get the idea.) I think the RSA algorithm is what I've been describing so you can learn more at that link.
×
×
  • 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.