Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. wonderful invention by the function name of strpad()... should allow you to fluff them up abit ;-) http://us2.php.net/manual/en/function.str-pad.php
  2. um... ya... it is secure... just when you login... just $_SESSION[user]=$row;... which would set their information from the database into that array all at once... as i said before... if someone tried to hack into a session... they have at least 1/1000000000 chance of finding the right one... and if you put your own user/password in... i personally have no issue with them knowing what their password is... if you want to remove it from sessions... just unset($_SESSION[user][password]);... if your using straight md5()/sha1() to encrypt your passwords... you prolly do want to remove em from the sessions... if you built your own encrypter... as long as you alone have the source for it, and are confident in it... that choice is up to you... its not needed in sessions...
  3. $text.='Name: '.$_POST[name]; $text.='<br>Town: '.$_POST[town]; . . . email(email,$text,$subject,$headers);
  4. yes... sessions are quite secure... first time they load, the server assigns a random based 30-40 character long "key"... so if a hacker tries to replicate that... they have about 1/1000000000 chance of finding 1 other one thats active... however... if registering globals is on... $_SESSION[test]='hello'; $test='world'; echo $_SESSION[test]; would output world... personally... i put all my user data into an array within sessions... so... say... $_SESSION[user][id]; then... you can... if(is_array($_SESSION[user][id])){} which is MUCH more secure
  5. you'd just run it as 2 seperate tasks... $data='text'; mysql_query("INSERT .... "); mail(email@address.ca, $data, $subject, $headers);
  6. missing a ; at the end ;-) <?php $con = mysql_connect("localhost","root",""); if(!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("user",$con); $username=mysql_real_escape_string($_POST['name']); $pwd=mysql_real_escape_string($_POST['pwd']); if(isset($_POST['name'])){ $r1=mysql_query("SELECT username,password FROM `user` WHERE `username`='$username'") or die(mysql_error()); while($res=mysql_fetch_array($r1)){ if($res['password']==$pwd){ echo "your registered sucessfully"; }else{ echo "please register"; } } } mysql_close($con); ?>
  7. just as a subnote... when you round()... if you have a MASSIVE number(before decimal place)... it does automatically translate it into scientific notation...
  8. ... your images are outside of the input fields... youd need to have... <td style="display:none; visibility:hidden;">
  9. index.php?lessonNr=1&chapterNr=1#text1 index.php#text1?lessonNr=1&chapterNr=1 both should work... are you sure you got the <a> named right?
  10. that should suffice i would think $mail_1 = array('name' , 'last name' , 'city' ); $mail_2 = array($f1,$f2,$f3); echo '<table>'; for($i=0; $i<=count($mail_1)-1; $i++){ echo '<tr>'; echo ' <td>'.$mail_1[$i].'</td>'; echo ' <td>'.$mail_2[$i].'</td>'; echo '<tr>'; } echo '</table>';
  11. lol... martial arts term... means "master"
  12. not tested... but i think it'd work... <? $username='JBloggs'; $query=mysql_query("SELECT * FROM `users` WHERE `login`='$username%'"); $row=mysql_fetch_assoc($query); if(empty($row)){ #add the user }else{ $lastnum=0; while($row=mysql_fetch_assoc($query)){ if(is_numeric($row[login]{strlen($row[login])-1})&&$row[login]{strlen($row[login])-1}>$lastnum) $lastnum=$row[login]{strlen($row[login])-1}; } $lastnum++; echo $username.$lastnum; } ?>
  13. you'd need to store that information into a database, when they're using that file...
  14. <? function randomkeys($length){ $pattern = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; for($i=0;$i<$length;$i++) $key .= $pattern{rand(0,62)}; return $key; } ?>
  15. you sure about that? $time = time(); $showtime = date("m/d/y-h:m:s",$time); echo $showtime;
  16. ... no... php is used for web/server based programs...
  17. varchar(255) would allow it to go upto a HUGE number... but if you switch it to a text field, it should be able to hold indefinatly HUGE numbers... however... i doubt you'd need that many figures for cash
  18. taith

    Doubt

    three months... as in this month, and three ago?
  19. taith

    Doubt

    not sure what your talking about... from what i see... your looking to find how many days are in each month...? this way is far easier... <? function get_daysinmonth($month, $year){ if(checkdate($month, 31, $year)) return 31; elseif(checkdate($month, 30, $year)) return 30; elseif(checkdate($month, 29, $year)) return 29; elseif(checkdate($month, 28, $year)) return 28; return FALSE; } for($i=1; $i<=12; $i++){ $months[$i]=get_daysinmonth($i,date(Y)); } ?>
  20. http://us.php.net/manual/en/function.ob-flush.php but youd have to get VERY creative... if it were me... i'd build it via javascrip/ajax...
  21. might i also note... & is &... not ?
  22. well... if your buffering your information... then i suppose you can use ob_flush() to output a progress bar... it'd be tough... but doable...
  23. not using php... its server side... you'd need something like... javascript/ajax to do progress bars...
×
×
  • 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.