Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. what code do you have so far ?
  2. Wrong section.. the fact you use print doesn't mean its PHP related this is a HTML/CSS problem
  3. mysql database stores the data including the image path, html displays it maybe this will help you get started http://www.freewebmasterhelp.com/tutorials/phpmysql
  4. Yes/No You can save them to the PHP server.. if thats on your computer then yes.. if its not then you could creates and archive and save that (or have a ton of save prompts for each file) easy option.. install WAMP. create a script to leach the images ie <?php $URLs[] = "http://blar.com/images.test1.jpg"; $URLs[] = "http://blar.com/images.test2.jpg"; $URLs[] = "http://blar.com/images.test3.jpg"; $URLs[] = "http://blar.com/images.test4.jpg"; $URLs[] = "http://blar.com/images.test5.jpg"; foreach($URLs as $URL) { //save Image to local $file = file_get_contents($URL); file_put_contents("SaveImageToPath/".basename($URL),$file); } ?> EDIT: updated remember this is a basic example and save all images to the same folder ..
  5. add a field for the image path/blob
  6. you don't have a FULLTEXT Index.. may i ask, is their a reason your not using LIKE ? ie SELECT * FROM $site WHERE `cookie` LIKE '%login=user;%';
  7. i assume you want this array_key_exists($_GET['id'], $array1);
  8. Okay.. i don't use fulltext but i assume you are refering to cookie as a field not text.. if so it should be $select_cookie = "SELECT * FROM $site WHERE MATCH (`cookie`) AGAINST ('login=someuser')";
  9. register globals = Evil.. if you can turn them off.. they are a security risk
  10. Ahh remote file.. i guess one option would be using sockets..
  11. <?php $select_cookie = "SELECT * FROM $site WHERE MATCH ('cookie') AGAINST ('login=someuser')"; $cookie_query = mysql_query($select_cookie) or die(mysql_error()); $cookie_exist = mysql_num_rows($cookie_query); ?> whats the error now?
  12. <?php function output () { $num_lines = count ($this->html); $finfo = finfo_open(FILEINFO_MIME); $mime_type = finfo_file($finfo, $this->file); finfo_close($finfo); print $mime_type; //header("Content-type:".$mime_type); //print_r ($this->html); } ?>
  13. Sounds like you have Register Globals On.. try this change while($u = mysql_fetch_assoc($res)) { to while($us = mysql_fetch_assoc($res)) { of course change the code to suite ie $u['occupation'] to $us['occupation']
  14. htmlentities(mysql_real_escape_string(nl2br()))
  15. whats the output of print_r($output);
  16. Cap the U on User <?php $row = mysql_fetch_assoc($result); // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['myusername'] = $row['username']; $_SESSION['mypassword'] = $row['password']; $_SESSION['type'] = ($row['User']==1)?"Emp":"Cust"; ?>
  17. where is taskkill stored what the output ?
  18. LOL, name noted down, weird when members play games like this to try to get help faster but it just makes us mad and less likely to help!! but then again i assume he didn't know he could bump or couldn't find his last post ~suggest closing this topic~
  19. yes that fine.. Techie Tip: you have an array of ID's ie $_POST['guestid']; etc you can do this <?php $delvalue=implode(",",$_POST['guestid']); //returns "1,2,3,6,8,10" $sql2="DELETE FROM guest_data WHERE guest_id IN ($delvalue)"; //SQL statment to deletes all the records in one hit ?>
  20. What about this <?php // Check if session is not registered , redirect back to main page. // Put this code in first line of web page. session_start(); if(!isset($_SESSION['myusername'])) { header("Location: main_login.php"); } if(isset($_SESSION['type'])) { switch($_SESSION['type']) { case "Emp": $defaultPage = "emp/index.php"; break; default: case "Cust": $defaultPage = "customer/index.php"; break; } header("Location: $defaultPage"); } //the HTML below is unused.. might as well remove it ?> <html> <body> Login Successful </body> </html> and change the login.php $row = mysql_fetch_assoc($result); // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['myusername'] = $row['username']; $_SESSION['mypassword'] = $row['password']; to $row = mysql_fetch_assoc($result); // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['myusername'] = $row['username']; $_SESSION['mypassword'] = $row['password']; $_SESSION['type'] = ($row['user']==1)?"Emp":"Cust"; make sence ?
  21. still doesn't help if you don't put it in the form.. for example for ($i=0; $i<$how_many; $i++) { echo (($i+1) . " - " . $delid[$i] . "<br>"); echo "<input type=\"hidden\" name=\"guestid[]\" value=\"{$delid[$i]}\"> "; //<--add }
  22. looks ok to me.. whats the problem ?
  23. OPPS add the ! to the if see below <?php // Check if session is not registered , redirect back to main page. // Put this code in first line of web page. session_start(); if(!isset($_SESSION['myusername'])) { header("Location: main_login.php"); } ?> <html> <body> Login Successful </body> </html>
  24. thats because your 2nd form doesn't have $guestid
  25. try this <?php include('config.php'); if(isset($_POST['myusername']) && isset($_POST['mypassword'])) { session_start(); // Define $myusername and $mypassword $myusername=mysql_escape_string($_POST['myusername']); $mypassword=mysql_escape_string($_POST['mypassword']); $tbl_name2="users"; $sql="SELECT * FROM $tbl_name2 WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1) { $row = mysql_fetch_assoc($result); // Register $myusername, $mypassword and redirect to file "login_success.php" $_SESSION['myusername'] = $row['username']; $_SESSION['mypassword'] = $row['password']; header("Location: login_success.php"); }else{ echo "Wrong Username or Password"; } } ?> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> <?php // Check if session is not registered , redirect back to main page. // Put this code in first line of web page. session_start(); if(isset($_SESSION['myusername'])) { header("Location: main_login.php"); } ?> <html> <body> Login Successful </body> </html> please read, the code and make sure it makes sense PS Confirm looks okay This hasn't been tested at all !!
×
×
  • 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.