Jump to content

Deoctor

Members
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Deoctor

  1. u redirect to some other page after that
  2. try this <? error_reporting(0); session_start(); // start session. ?> <!-- header tags, edit to match your own, or include template header file. --> <html> <head> <title>Login</title> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> <p align="center">Members only. Please login to access this document.</p> <table align="center" border="0"> <tr> <th> Username: </th> <th> <input type="text" name="username"> </th> </tr> <tr> <th> Password: </th> <th> <input type="password" name="password"> </th> </tr> <tr> <th colspan="2" align="right"> <input type="submit" name="submit" value="Login"> </th> </tr> </table> </form> </body> </html> <? // If all is well so far. if(isset($_POST['submit'])) { echo "Hai"; $username=$_POST['username']; $password=$_POST['password']; session_register("username"); session_register("password"); // register username and password as session variables. $dbHost = "sql01.dk"; $dbUser = "elmerdahldk"; $dbPass = "rNnj5Tc2"; $dbDatabase = "elmerdahldk"; $mysqli = mysql_connect("$dbHost", "$dbUser", "$dbPass"); mysql_select_db($dbDatabase, $mysqli) or die("Can not connect"); // Check connection if (mysql_error()) { printf("Unable to connect to database: %s", mysql_error()); exit(); } $sql = mysql_query("SELECT * FROM users WHERE username = '$username' and password='$password'"); //$fetch_em = mysql_fetch_array($sql); $numrows = mysql_num_rows($sql); if($numrows != "0") { $valid_user = 1; } else { $valid_user = 0; } // If the username exists and pass is correct, don't pop up the login code again. // If info can't be found or verified.... if ($valid_user == 0) { echo " sorry wrong details"; session_unset(); // Unset session variables. session_destroy(); // End Session we created earlier. // escape from php mode. } else { echo "Success"; } } ?>
  3. i am just now checking ur form, lots of bugs are there, fixing it out..
  4. action shoould be some thing like this action="<?php echo $_SERVER['PHP_SELF'];?>"
  5. echo " <a href=\"http://support.dell.com/support/downloads/index.aspx?ServiceTag=". textDecode($item->SSN)."\" target=\"_blank\">". textDecode($item->SSN)."</a> ";
  6. try some thing like this echo "$td3" ."<a href='http://support.dell.com/support/downloads/index.aspx?ServiceTag=".textDecode($item->SSN)."' target="'_blank'">".textDecode($item->SSN)."</a>";
  7. for this one i cannot do anything.. u have to check the files before.. for this what u need to do is that instead of echo use some thing like this $value="C:\\Users\\kevin\\Documents\\My Scans\\scan"; //echo $fole."<br>"; for($i=1;$i<=130;$i++) { if($i>=100) { $val1=$value.'0'.$i.".txt<br>"; $fole .= file_get_contents($val1); } elseif($i>=10) { $val2=$value.'00'.$i.".txt<br>"; $fole .= file_get_contents($val2); } else { $val3=$value.'000'.$i.".txt<br>"; $fole .= file_get_contents($val3); } } echo "File====><br> ".$fole; ?>
  8. try some thing like this $value="C:\\Users\\kevin\\Documents\\My Scans\\scan"; for($i=1;$i<=130;$i++) { if($i>=100) { echo $value.'0'.$i.".txt<br>"; } elseif($i>=10) { echo $value.'00'.$i.".txt<br>"; } else { echo $value.'000'.$i.".txt<br>"; } }
  9. try this $fole=file_get_contents('C:\\Users\\kevin\\Documents\\My Scans\\scan0001.txt'); echo $fole;
  10. sorry to tell u this but i cannot able to understand what u need,...
  11. u can do that some thing like u need to make a group for that email id which is unique.. these things u need to do in the mail server....this thing i too dont knoowww... obviously this is one solution for this.. the other is that u write a script that when ever he sends an email u fetch the email and then search for the contacts for that mail id and run a script so that it can send mails.. i have done with the bulk mailer.. contact me if u need any help
  12. i dont think top will work under mysql. it works in the sql server.. try some thing like this SELECT DISTINCT( `cloumnA` ), COUNT( `columnA` ) FROM `tablename` GROUP BY 1 ORDER BY 2 DESC LIMIT 0,10;
  13. oops my mistake echo "<table> <tr> <td>"; echo $line["name"]; echo "</td> <td>"; echo $line["finalTime"]; echo "</td> </tr> </table>";
  14. for($i = 1; $i <= 10; $i++) { if($line = mysql_fetch_assoc($result)) { <table> <tr> <td> echo $line["name"]; </td> <td> echo $line["finalTime"]; </td> </tr> </table> //echo "".$i."=".$line["name"]."".$i."=".$line["finalTime"]; } } try this
  15. try this code.. <form enctype="multipart/form-data" action="upload.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="9999999999999999" /> Choose a file to upload: <input name="uploaded" type="file" /><br /> <input type="submit" name="submit_x" value="Upload File" /> </form> <?php //Working for uploading the files of a particular type if(isset($_POST['submit_x'])) { function file_upload_error_message($error_code) { switch ($error_code) { case 0: return 'There is no error, the file uploaded with success...'; case 1: return 'The uploaded file exceeds the upload_max_filesize directive in php.ini'; case 2: return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'; case 3: return 'The uploaded file was only partially uploaded'; case 4: return 'No file was uploaded'; case 6: return 'Missing a temporary folder'; case 7: return 'Failed to write file to disk'; case 8: return 'File upload stopped by extension'; default: return 'Unknown upload error'; } } $host="localhost"; $user="root"; $pass="admin"; $db="develop"; mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); $query="select type_name from filetype"; $result=mysql_query($query); ini_set("display_errors",1); //error_reporting(E_ALL); $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $uploaded_type=strtolower(substr($_FILES['uploaded']['name'],strrpos($_FILES['uploaded']['name'],'.')+1)); print_r($_FILES['uploaded']); $error_code=$_FILES['uploaded']['error']; $error_message = file_upload_error_message($error_code); echo "Name ".$_FILES['uploaded']['name']."<br>"; echo "Type ".$_FILES['uploaded']['type']."<br>"; echo "Error ".$error_message."<br>"; echo "Size ".$_FILES['uploaded']['size']."<br>"; //echo "<br>FileX ".$uploaded_type; while($row = mysql_fetch_array($result)) { if($uploaded_type==$row['type_name']) { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; break; } else { echo "Sorry, there was a problem uploading your file."; } } } } ?>
  16. so can u tell me what u have tried with i mean ur code... i believe u want to get the contents of the site if yes try using this script here actually i am wrting the content back in the browser.. but u can try returning it to a file so that u can fetch what ever u want by file_get_contents <?php $url = '[url=http://php.net]http://php.net[/url]'; // disguises the curl using fake headers and a fake user agent. function disguise_curl($url) { $curl = curl_init(); // Setup headers - I used the same headers from Firefox version 2.0.0.6 // below was split up because php.net said the line was too long. :/ $header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; $header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; $header[] = "Cache-Control: max-age=0"; $header[] = "Connection: keep-alive"; $header[] = "Keep-Alive: 300"; $header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; $header[] = "Accept-Language: en-us,en;q=0.5"; $header[] = "Pragma: "; // browsers keep this blank. curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_REFERER, '[url=http://www.google.com]http://www.google.com[/url]'); curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($curl, CURLOPT_AUTOREFERER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 10); $html = curl_exec($curl); // execute the curl command curl_close($curl); // close the connection return $html; // and finally, return $html } // uses the function and displays the text off the website $text = disguise_curl($url); echo $text; ?>
  17. in the usb version i think there is a possiblity for you to install it some where and then write the same in the dvd, but i never tried this before.. ju8st have a check
  18. have u checked with ur mysql settings.. i think the user is directly accessing ur mysql through the root user id or else might have created an other mysql user try changing the mysql user pass for all the user...
  19. hmmmm....never ever thought of this i dont think so..it will work but try using the usb version of the xampp.. try ur luck..
  20. yes i found that out.. it is quite good. my internet is quite guud here so that is y missed it out in page loading.......................
  21. curl_setopt hai 10q for that can u show me an example code
  22. <?php /* Titel en send to email adres */ $emailTitle = '*****'; $webMaster = 'XXX@XXX.com'; /* Textfield namen */ $naamField = $_POST['naam']; $bedrijfField = $_POST['bedrijf']; $emailField = $_POST['email']; $telefoonField = $_POST['telefoonnummer']; $opmerkingenField = $_POST['vraag']; $body = <<<EOD <br><hr><br> Naam: $naamField <br> Bedrijf: $bedrijfField <br> Email: $emailField <br> Telefoon: $telefoonField <br> Opmerkingen en vragen: $opmerkingenField<br> EOD; $headers = "From: $emailField\r\n"; $headers = "Content-type: text/html\r\n"; $success = mail($webMaster,$emailTitle,$body,$headers); $theResults = <<<EOD this one u modify it as <?php if(isset($_POST['verzenden'])){ /* Titel en send to email adres */ $emailTitle = '*****'; $webMaster = 'XXX@XXX.com'; /* Textfield namen */ $naamField = $_POST['naam']; $bedrijfField = $_POST['bedrijf']; $emailField = $_POST['email']; $telefoonField = $_POST['telefoonnummer']; $opmerkingenField = $_POST['vraag']; $body = <<<EOD <br><hr><br> Naam: $naamField <br> Bedrijf: $bedrijfField <br> Email: $emailField <br> Telefoon: $telefoonField <br> Opmerkingen en vragen: $opmerkingenField<br> EOD; $headers = "From: $emailField\r\n"; $headers = "Content-type: text/html\r\n"; $success = mail($webMaster,$emailTitle,$body,$headers); $theResults = <<<EOD }
  23. can u provide me with a sample of how to set that ??
  24. it is not regarding the errors that i am asking about.. what i am trying to say here is that suppose if an user logs into ur site then these are the following details u can fetch from that SERVER_ADDR REQUEST_METHOD REQUEST_TIME QUERY_STRING HTTP_REFERER--used to find whether he is coming from a valid url... REMOTE_ADDR SCRIPT_FILENAME and so on...... these are quite helpfull for you to trace the things while u are working on.. also have a check whether some one is directly accessing ur database and deleting the things change ur mysql password and also the access levels for the user id...
  25. i hope this is what u are looking for http://php.net/manual/en/function.mysql-insert-id.php
×
×
  • 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.