Jump to content

SharkBait

Members
  • Posts

    845
  • Joined

  • Last visited

    Never

Everything posted by SharkBait

  1. [quote author=AdRock link=topic=105648.msg422157#msg422157 date=1156553523] try this [url=http://www.phpfreaks.com/tutorials/40/0.php]http://www.phpfreaks.com/tutorials/40/0.php[/url] [/quote] Ah I didnt think about using the MD5 hash for the authentication code.  Any reason not to use their password hash??
  2. I knew someone would come up with anther MillionPixel website.  :)
  3. Is it possible, instead of having to reply to ones own thread in the Freelancer section to bump it, what about if you were to edit the main post and have it 'bump' itself? I know this is possible in other forums, not sure if SMF can do it.
  4. How are they done in general? Example:   Joe signs up on a website, and they are emailed with an activation code.  They click on it and enter their password and their online account is activated. I guess what I am looking for is, whats the best way to create the activation code? Random characters that are stored upon creation of the new account? Then get attached to the email in the form of some link that can be clicked on? User clicks on the link, the url has the activation code in it, it's then queried against the database and checked if it matches or not?
  5. I didnt read the entire post my eyes started to bugger on me but... My sites consist of userlevels.  Each level can do a different thing. Level 1's can edit things that they created Level 3's can edit/add/delete things they or other people created and also access places that level 1's cannot. Level 5's are the sysadmins (well me) I can do everything anyone else can do and more.  Level 1's and Level 3's cannot goto sections that Level 5's can. All of this is done with by storing the User's level (from the database) into a session when they first login.  I do checks a various spots to see what they can or cannot access. I only use 1 cookie in one of my sites. This helps me 'pass' the session over to a sub-domain. As for your session dying.  Have you checked to make sure that the php.ini file is set properly for session timeouts?  I know my don't expire until the user closes their browser.  Perhaps the session is set another way? I know on my employer's website they last until you close the browser, but one of our internal servers, the session is set to last 4 hours.
  6. Think you need to look at strpos(); That will tell you the position of the string then you could substr(); [code] <?php $loc = strpos("y", "arrayrandom"); $word = substr("arrayrandom", $loc, str_length("arrayrandom")); ?> [/code] I think what that should do is set $loc to 5 then substr arrayrandom starting at position 5 (the "y") and go until end of the length of the rest of the string. If I am wrong, at least the general idea is there ;)
  7. One thing I do with my variables in the VALUES section is '{$valuename}', '{$valuename2}' As for your escape character, how are you doing it? I do something like [code=php:0]$name = str_replace("'", "\'", trim($_POST['name']));[/code] Other use the mysql_escape_character() function. Show your code for escaping and we can look further into it for you.
  8. I personally would start out with just trying to move a file to a directory [code] <?php if(move_uploaded_file($_FILES['upload']['tmp_name'], "somefolder/tostore/{$_FILES['upload']['name']") {   // File moved succesfully } else {   // Error with moving file } ?>[/code] After you can succesfuly move a file, then learn to do the MySQL (or whatever database you use) queries to insert the information you need.  INSERT, UPDATE, DELETE will be the ones you'll need to look at. Then look at tackling the class that handles the image uploading. Now if you can do all that and I have completely mis-read your post I am sorry. :)
  9. [quote author=wildteen88 link=topic=105329.msg420825#msg420825 date=1156352459] Uploaded it [url=http://homepage.ntlworld.com/cshepwood/circles/]Clicky[/url] [/quote] That's awsome, definately a better way then I tryed to explain it and the circle is nicer too What program did you to capture the video though?
  10. I just put it onto my little site and it works nicely in a blog type environment.
  11. Hi,   PHP can only read files server side correct? I am creating a mini-script where I can have PHP read from a file (a CSV) and parse through it. I guess I will need to upload the file to the server, read the file, do my thing and delete the file after succuessful completion. Right now I move the file manually, and then just manually change the filename/path in the script to have it read. There is no other way to do this is there? I do have to put the file on the server correct? Just making sure that this is the way I will have to do it :)
  12. PHP can do all of that. As for if you're willing to learn how to do it and how much time you have, thats up to you. Uploading files via a HTML form and adding comments etc isnt too difficult. And as for paying someone to do it. Sure there are lots of people out there willing to make extra money.  Check out the Freelancer board here at PHPFreaks.com :)
  13. INT field is an integer  1493 is an INT 1,493 is technically a string You would have to format the output to display the comma for you.  Unless of course there is a particular function that I am unaware of to format numbers like that for you. I know there is one for formating decimals....
  14. I also use [code=php:0] str_replace("'", "\'", "There's a tree"); [/code]
  15. I use the ellipse tool make sure you have the setting of it set to 'unconstrained' and you should be able to create anysize you want. I'm using Photoshop CS so if you have something different it might not be the same.  I also make sure that I have it also set to Paths and not Shape Layers. Create the circle (hold shift down for perfect circle) Once it is the size you want, right-click and 'Make Selection...' I choose a feather radius of 0px. Then  choose the menus: Select -> Modify -> Border: 1 px Then choose the colour you want and alt-Backspace to fill the border in.
  16. [quote author=Daniel0 link=topic=105014.msg419426#msg419426 date=1156168183] I've heard people who think that Internet Explorer is the internet, so I don't think that IE will be a thing in the past for the next many years. [/quote] Personally I hate this. People who think the 'Internet' is IE or even the web itself. Who here has used or still uses things like Gopher? IRC? Archie? Usenet etc?  I miss the days of the net where you had to know how to use a computer to do anything with it.  Huh?? As for IE, it will always be around.  Since Windows is still one of the most used OS in the world, IE will always be around.  Now if MS were to play nice and follow the W3 consortium, maybe it could be more fun to design for ;) ober as of SP2 in XP you can remove the IE install.  I too hate having to code all my sites in FF and then seem the broken in IE because IE doesnt follow the rest of the pack. Though IE7 has been a little bit better, but you shouldn't rely on coding your site in a Beta of an application ;) So I still have IE6 on my machine.  Also have Swift (like Safari), Firefox, Opera, I use my linux machine to look at Konquerer, and occationally I still use Linx :) And why do people still use Frontpage for doing websites!!!!  *whew* ok I am done :)
  17. If you create a circle with the shape tool, make a selection and then Select -> Modify -> Border of 1 or 2, you could just get the outline for it.
  18. Has anyone used TinyMCE as a WYSIWYG editor? http://tinymce.moxiecode.com/index.php I just looked through it and it doesn't seem to be bad, especially for being free. Just wana see if anyone here has ever used it.  I though of implimenting it into my employer's website and then using it myself for my various tasks. Thanks
  19. There is a hack for IE to get the hover effect to work with it. http://www.xs4all.nl/~peterned/csshover.html talks about it. Its a pain but there is a way to make IE work a bit better.  But yea.. it isnt pure CSS ;) Perhaps one day IE will follow the other browsers and play nice.
  20. [code] <?php $password = "mypass" $username = "user123" $strqry = "SELECT * FROM users WHERE password = '{$password}' AND username = '{$username}'"; $query = mysql_query($strqry) or die("MySQL Error: <br />{$strqry} <br /> ". mysql_error()); $num = mysql_num_rows($query); if ($num < 1) {   // Password User not found in database or do not match } else {   // Password/username is valid   header("Location: login_success.php");   exit(); } ?> [/code] Gives you the jist of it :)
  21. I never thought of using print_r with a true on it. I usually use if(isset($_POST['chkboz[]'])) because like Barand mentioned, they only get posted if they are checked. :)
  22. I has a similar question: http://www.phpfreaks.com/forums/index.php/topic,103450.0.html There is a link there to information about creating emails with attachment via PHP. 
  23. when they enter their email address validate it to make sure its leget. like someone@hotmail.com then take the email address and then... I guess explode it on the @ [code] <?php $email = "someone@hotmail.com"; $checkDomain = explode("@", $email); if($checkDomain[1] == "hotmail.com") {   // User is hotmail - don't allow } else {   // User is not hotmail - Allow } ?> [/code] There some issues with that code, but it can be cleaned up a bit.  I'm sure there are other way about it to, but the above might help give you a general idea.
  24. So in non-pseudo code: [code] <?php if (isset($_POST['submit'])) {   $strqry = "UPDATE foo SET field ='{$_POST['value']}' WHERE bar = 'woo'";   $query = mysql_query($strqry) or die("MySQL Error: <br /> {$strqry} <br />". mysql_error());   $num = mysql_affected_rows($query);   if($num > 0) {     // Database was updated     } else {     // database was not updated     } } // Display Form $strqry = "SELECT * FROM foo WHERE bar = 1"; $query = mysql_query($strqry) or die("MySQL Error: <br /> {$strqry} <br />". mysql_error()); $item = mysql_fetch_array($query, MYSQL_ASSOC); ?> <!-- Do your form --> Enter Value <input type="text" name="bar" value="<?php echo $item['bar'];?>" /> <input type="submit" value="submit" name="submit /> <!-- End Form --> [/code] Of course you'll need data validation etc but thats the jist of updating a field in SQL using an HTML form.
  25. [quote author=AndyB link=topic=105088.msg419617#msg419617 date=1156188673] you could download one from www.digitalmidget.com/php_noob2006/captcha.php [/quote] That's the one I recommend. its easy to use and layed out nicely if you need to modify it to your needs.
×
×
  • 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.