Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. change mail($email, Your Temporary Password. ', $body 'From: admin@'); to mail($email, 'Your Temporary Password. ', $body, 'From: admin@'); also you have an extra } at the end
  2. you could be missing an { without seeing more it hard to say
  3. something like this $data = mysql_escape_string($_GET['step']); $result = mysql_query("INSERT INTO table SET `Fieldname` = '$data' ");
  4. $query = "UPDATE registration SET `password`=PASSWORD('$p') WHERE user_id = $uid"; $result = @mysql_query ($query) or die(mysql_error()); if(mysql_affected_rows()==1) add debug info also what follows the if ?
  5. Yes but i have a habbit of filtering input at the start and then rebuild it.
  6. yep , had to use it a few times, it does save some coding
  7. //...Snip <label>Select a user:</label> <select name="username" id="name"> <option value="">Select a user</option>'; for($i=0; $i<$number; $i++) { $name = mysql_result($result,$i,"name"); echo '<option value="'; echo $row[name]; echo '"'; if($selectedname==$row[name]) echo " selected"; echo '>'; echo "$name"; } echo '</option>'; //******Add the line below $selectedname = $_GET['username']; echo "Selected users - $selectedname";// debug info /* This section builds the queries and gets the data for each criteria in the table, not sure if I need to do this much or not $getphoneinfo = "SELECT make,model FROM inventory WHERE name LIKE '$selectedname'"; //...Snip
  8. you could change <form action="<?php echo $_SERVER[php_SELF]; ?>" method="POST"> to <form action="<?php echo "?pubdir_id=$pubdir_id"; ?>" method="POST">
  9. can you post the code ?
  10. oops setcookie("loggedin", "TRUE", time()+(3600 * 24), "/"); setcookie("mysite_username", "$user", time()+(3600 * 24),"/"); //updated 3rd = expire, 4th = path echo "You are now logged in!<br>"; echo "Continue to the <a href=\"index.php\">Home</a> Page.";
  11. try adding the path to the cookies Add , "/" ie setcookie("loggedin", "TRUE", time()+(3600 * 24), "/"); setcookie("mysite_username", "$user", "/");
  12. this is the PHP section not html,, but your need to look into span and background/style your syntax is wrong,, i tell you how but you already asked th question in the HTML/CSS section so you know its not php...! EDIT: LOL okay see discomatt post thats what you need
  13. Well in php3 i was good pratice but now days i don't think it really matters that much.. its the same with most things Security vs Usability Speed vs Memory Memory vs storage etc etc etc etc even if someone found the perfect match ups and build a system of rules.. your then have the problem of long term vs short term cost of the system as a whole, as it would probably take longer to write the system. ... okay this isn't the best place for these posts, dannybrazil head will probably explode..lol i'll let you have the final say if you like
  14. Yes/No.. Its not PHP that does it, its HTML/CSS, PHP just sends it to the browser. ie echo "hello <font color=\"#00ff00\">world</font>";
  15. on the legal side (i'm in the UK), from what i know.. if your site/host contains copyrighted materal and copies, modifies, display, perform or distribute in anyway than thats illegal. as for Peer2Peer law.. well thats still in court last i hear'd! as for the FTP thing, years ago before torrents, you could find a FTP server that had a ratio share you upload 20Meg you can now browse the FTP server and download 10Meg (if the ratio was 2/1) these FTP servers still exist but are less common "FTP ratio server" EDIT: Follow up from thorpe, you may want to include a disclaimer on the signup say the user uploading the stuff is responceble and not you or your host provider
  16. Had to be install on the clients PC, closes to get to a web solution would be a JavaApplet or ActiveX (BHO) you can get applets (i used for a projects) its a small FTP upload (no install needed) and you could include the FTP setting with the droplet ..Searching for it... maybe this http://ftp-client-uploader-creator-for-windows.dev-zero-g.qarchive.org/ i havn't used that one (well it was years ago) EDIT: as for the form review this http://uk2.php.net/manual/en/features.file-upload.common-pitfalls.php
  17. If you uploading via from then no, php can't even montior how much data has been passed, as for FTP (a resumable server), your need to upload from an FTP client, whish also allows resumable uploads, when you attempt to re-upload a file that already exists the client will prompt the user to append or overwrite
  18. FTP will NOT timeout (unless the connection is lost) FTP is better (one with resumable uploads) as for uploading via a form you may want to check include the max_input_time directives EDIT: but if the upload via a from fails half way you can not resume (unless you use CGI or something)
  19. simple test <?php define ('MAX',2000000); function f1() { for($i=0;$i<MAX; $i++) { $c = "test $i"; } } function f2() { for($i=0;$i<MAX; $i++) { $c = 'test ' . $i; } } $t1 = microtime(true); f1(); $timed1 = (microtime(true) - $t1); echo "Time 1: $timed1 <br>"; $t2 = microtime(true); f2(); $timed2 = (microtime(true) - $t2); echo "Time 2: $timed2 <br>"; echo "Time 2 is faster by: ".($timed1-$timed2)." over ".MAX." iterations "; ?> my results edit: which isn't even 0.6 but 0.3 (rounded up) last test was in php5 now in php 5.2
  20. i'm using firefox,, i just tried with IE7 and ..its fine.. if someone else can test http://www.gameyin.com/index.php user = tester pass = tester
  21. True, but php 5 is smarter than php 3 when it comes to quotes if you do 2 million iterations of echo 'Test '.$avar; echo "Test $avar"; your save yourself 0.6 of a second.. personally i code quicker with double quotes and the code is smaller.. thus less memory so to sum up.. i perfer double quotes
  22. oooops i overlooked that yes it will not parse in single quotes just excape the double quotes like this $email=$row['email']; $subject=urlencode($row['title']); echo "<a href=\"mailto:$email?subject=$subject\">$email</a>";
  23. the thing is, i got to http://www.gameyin.com/index.php click login enter the username & password then click 'Home' and everything seams okay! are you getting something different ? if you click back, then that will cause the problem
  24. that looks okay.. maybe use urlencode $email=$row['email']; $subject=urlencode($row['title']); echo '<a href="mailto:$email?subject=$subject">'.$email.'</a>';
  25. I just created an account (tester) it seams to be ok, (unless i use the back button) so you could use a metatag redirect ie <?php echo "You are now logged in!<br>"; echo "Continue to the <a href=\"index.php\">Home</a> Page."; ?> to <?php $url = "index.php"; $time = 5; echo "<html><head> <title>Logged in</title> <META http-equiv=\"refresh\" content=\"$time;URL=$url\"> </head> <body> <center>You will be redirected automatically in $time seconds. or click <a href=\"$url\">here</a> </center></body></html>"; ?>
×
×
  • 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.