Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. record the time they first visited, then each time they visit a page compare that time to the current time...if the set amount of time has transpired, deny access. Use sessions, their IP address, or cookies, to track the time they first visited.
  2. why would you reinvent the wheel using that function, genericnumber1, when the serialize function does exactly that, and more...it saves any php object to a string that is suitable for storing in a database or text file...include array indexes.  Nevermind multidimensional arrays.......... http://www.php.net/serialize http://www.php.net/unserialize
  3. What do you mean "determine the time for user in the forum"? Like how SMF has "Total time logged in"?
  4. the preg_ls function was taken from here: http://us3.php.net/manual/en/class.dir.php#60562 [code]<?php function preg_ls ($path=".", $rec=false, $pat="/.*/") {   // it's going to be used repeatedly, ensure we compile it for speed.   $pat=preg_replace("|(/.*/[^S]*)|s", "\\1S", $pat);   //Remove trailing slashes from path   while (substr($path,-1,1)=="/") $path=substr($path,0,-1);   //also, make sure that $path is a directory and repair any screwups   if (!is_dir($path)) $path=dirname($path);   //assert either truth or falsehoold of $rec, allow no scalars to mean truth   if ($rec!==true) $rec=false;   //get a directory handle   $d=dir($path);   //initialise the output array   $ret=Array();   //loop, reading until there's no more to read   while (false!==($e=$d->read())) {       //Ignore parent- and self-links       if (($e==".")||($e=="..")) continue;       //If we're working recursively and it's a directory, grab and merge       if ($rec && is_dir($path."/".$e)) {           $ret=array_merge($ret,preg_ls($path."/".$e,$rec,$pat));           continue;       }       //If it don't match, exclude it       if (!preg_match($pat,$e)) continue;       //In all other cases, add it to the output array       $ret[]=$path."/".$e;   }   //finally, return the array   return $ret; } $pictures = preg_ls("/path/to/pictures/"); foreach ($pictures as $picture) { $iw = new imageWaterMarker(); $iw->image_location = 'test.jpg'; $iw->image_type = 'jpeg'; $iw->size = 1;  //This could be any value from 1 to 5 $iw->copyright_text = '(C) 2004 : here'; $iw->markImage(); $iw = ""; } ?> [/code]
  5. Try removing the "?>" after "if( $listAction && $listAction == "csv" ){", see if that helps. Also, if you are still having problems, remove the attachment header and change the content type header to be text/plain, then check the output to ensure that it is what you want. [code]<?php if( $listAction && $listAction == "csv" ) { header("Content-type: text/x-csv"); header("Content-Disposition: attachment; filename=CMD_Members.csv"); print "Id, First Name, Last Name, Organization, Email Address, Package, Pay By, Date Modified, Status". "\n"; $row = 0; foreach($_POST["all"] as $value){ $sql = "SELECT mbrID, fName, lName, org, email, mbr_pkg, payType, active_date, status FROM members where mbrID = '".$value."'"; $rval = mysql_query($sql); while ($data = mysql_fetch_assoc($rval) ) { ++$row; if($data["status"] == '0'){ $status = "Pending"; }elseif($data["status"] == '1'){ $status = "Activated"; }elseif($data["status"] == '2'){ $status = "Deactivated"; } print $data["mbrID"] . ",".$data["fName"] . ",". $data["lName"].",".$data["org"] . ",".$data["email"]. ",".$data["mbr_pkg"]. ",".$data["payType"].",".$data["active_date"].",".$status."\n"; } } } ?>[/code]
  6. If you just want to get all of the variable out of $_POST, use extract. http://www.php.net/extract If you are wanting to use a loop for the number of pictures: [code]$picture_count = 10; for ($a = 1; $a <= $picture_count; $a++) {   echo "title" . $a . ": " . $_POST['title' . $a] . " - picture" . $a . ": " . $_POST['picture' . $a] . "<br />"; }[/code] That's the general idea anyway.
  7. If you are only wanting the number of records, and not the data itself, use a count query. [code]SELECT COUNT(*) WHERE WHERE id = '$id' AND read = 'true'[/code] Then use mysql_result to get your answer: [code]$result = mysql_query("SELECT COUNT(*) WHERE WHERE id = '$id' AND read = 'true'"); $count = mysql_result($result, 0);[/code] The reason for doing this is because if you use Cagecrawler's method you are actually retrieving the data and storing it in a variable.  If there is a large amount of data retrieved by the query, it will take up a large amount of memory as well.  Additionally, if your web server and database server are different machines, that data will have to traverse the network, even if you aren't going to use it for anything other than a "mysql_num_rows" function.
  8. [code]$column = 1; print "<table>"; while(($row = mysql_fetch_assoc($results)) !== false) {    if ($column == 1) { print "<tr>"; } print ' <td> <a href="http://www.mysite/myfolder/cvdata1.php?search=' . $row['Bloom_Name'] . '"> <img src="http://www.mysite/myfolder/' . $row['Bloom_Name'] . '.jpg" width="150" height="150" border="0"> </a><br /> ' .$row['Bloom_Name'] . ' </td>'; if ($column == 5) { print "</tr>"; $column = 0; } $column++; } if ($column < 5) { while ($column < 5) { $column++; echo " <td>&nbsp;</td>"; } echo "</tr>"; } print "</table>"; [/code]
  9. Use the file and explode functions. http://www.php.net/file http://www.php.net/explode or fgetcsv. http://www.php.net/fgetcsv The latter has a user provided function that might work for you: http://us2.php.net/manual/en/function.fgetcsv.php#70957
  10. The guy that runs the page that you linked to even states at the bottom: [quote] You may use the XML interface to look up MD5 hashes from all the databases that I search: [/quote] He doesn't reverse it...he searches a database(s) of hashes for a match and returns that EDIT: I tried several simple strings...if you wanted to reverse passwords or some such, anything but the simplest of passwords will probably not be found...even "P@SSword" wasn't in the database.
  11. [quote]like i said i grabe it of a site[/quote] Maybe you should grab the rest? to remove it, just remove the "function ...." stuff.  Of course you would also have to remove any instances of it being used as well.
  12. You can't reverse md5, only convert a string that you think is equivalent and compare the result
  13. I don't know...it's your function...
  14. Basically save $_POST to a $_SESSION element... [code]$_SESSION['previous_form_data'] = $_POST;[/code] Then to use it in the form: [code]echo '<input type="text" name="somefield" value="' . $_SESSION['previous_form_data']['somefield'] . '">[/code]
  15. Where is the rest of the "generateRandID" function?  You only have four characters that don't make up anything.
  16. What exactly isn't working?  What is the expected result, and what is the actual result?  "POST variables not working" doesn't really narrow it down any.
  17. You need to escape the double quotes inside of the double quotes: [code]echo "<div id=\"loggedin\"><p class=\"success\">Welcome {$_SESSION['name']}</p></div>";[/code]
  18. It is used to change the default way of saving and retrieving session data for a user. The "Remember Me" option works via cookies.
  19. They are probably using a youtube api of some sort... http://www.youtube.com/dev
  20. what is the entire line of code? use [code]<?php echo '<form method="post" action="' . $_SERVER[PHP_SELF] . '">'; ?>[/code] or [code]<form method="post" action="<?php echo $_SERVER[PHP_SELF]; ?>">[/code]
  21. http://us3.php.net/manual/en/features.file-upload.php It's difficult to trouble shoot code when there is none.
  22. using this line: [code]$field = mysql_fetch_row($query);[/code] you are retrieving the object that is that row.  You need to use the mysql_result function: [code]$query = mysql_query("select location from $table where username = '$user'"); $field = mysql_result($query, 0, "location"); $return_array = unserialize($field);[/code]
  23. When you are looking to update a record in a database, such as a blog entry, the overall idea is: - list the database records, usually in a table, each table row contains an entry along with a link to the page that will display the data for editing.  The link will usually be something like "edit.php?id=####", where #### is the unique id of that record. - edit.php will retrieve the id ($_GET['id']) and use it in a query to retrieve the data from the database.  Then take that data, and place it into the form fields for editing. - the user will edit the values, then submit the form to another page, "update.php".  That page will receive the input, then run an UPDATE query to change the values in the database.
  24. Have you looked at the GD functions?  Specifically imagerotate? http://www.php.net/imagerotate
×
×
  • 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.