Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. to hide your IP, you use a proxy server.. what this does, is when you enter a URL the proxy opens it and send the data to you.. so the Host server (from the URL) see the proxy connecting.. thus gets the proxies IP not yours.. so if you use cURL on your web site to get data from another site that site see your server's IP not yours) so you could create a web proxy.. Now theirs loads out their but.. remember when your using a proxy your sending all your data to the proxy and the proxy is sending it on to the host server.. not great if you want to hide your personal details...
  2. you mean resize the iframe!.. yes you can do that.. to be trueful.. your not gong to be the one in control of the look and feel.. in the end its down to the end user.. you could generate a XML file and supplie a XML parase and formatter. theirs probably 101 ways to do this but with knowing what your aiming for its kinda hard to say.. if the problem is "it looks crappy" then change the CSS to make it look good
  3. Ok.. first your need "Remote Include" all servers that are going to use your script, GoodLuck with that.. (unlikly to happen).. if its a news feed then surely they can include the URL in a iframe or something.. Why did you plan on using an included file ? EDIT: with a news feed for version you could have the URL have a link like newsfeed.php?ver=1.2
  4. //This line. we all know (only fix was correcting the use of the array) $rules=mysql_query("SELECT * FROM rules WHERE ladderid='{$rules['ladderid']}'"); //Step 1, Fetch_array -> Pass data ($rules), //Step 2, return data and set to $rules. $rules=mysql_fetch_array($rules); as for the function.. i fixed a few common mistakes.. i didn't review the logic my basic fix refers to the $rules[ladderid] 's, if it makes a differents then cool, if not.. well theirs a few bugs out of the way
  5. basically its a proxy server.. not a great idea.. as your hiding you ip from one site but handing all your transaction data to the proxy instead....
  6. it maybe in the manual! let me check.. oh yes it is.. http://uk2.php.net/manual/en/function.explode.php and even better it has examples....
  7. Cleaned up function editrules($rules){ $rules=mysql_query("SELECT * FROM rules WHERE ladderid='{$rules['ladderid']}'"); $rules=mysql_fetch_array($rules); echo" <body style='margin:0px'> <div style='margin:10px'> <br /> <table cellpadding='4' cellspacing='0' border='0' width='95%' class='tborder' id='optionsform'> <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' colspan='2'> <b>Rules Manager</b> </td> </tr> <form method='post'> <tr valign='top'> <td class='optiontitle' colspan='2'><div align='center'>Rules For Ladder ID {$rules['ladderid']}</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> <textarea name='rules[rules]' rows='20' cols='80'>{$rules['rules']}</textarea><br /><br /> <input type='hidden' name='{rules['ladderid']}' value='{$rules['ladderid']}'> <input type='hidden' name='act' value='updater'> <input type='submit' name='submit' value='Update Rules >>'></td> </form></div> </td> </tr> </table>"; } function updater($rules){ global $config; include("./check.php"); $rules['rules']=allowhtml($rules['rules']); mysql_query("UPDATE rules SET rules='{$rules['rules']}' WHERE ladderid='{$rules['ladderid']}'"); $adminlog[admin]="{$_SESSION['name']}"; $adminlog[details]="[Edited Rules] Edit Rules: Ladder ID: {$rules['ladderid']}"; adminlog($adminlog); echo" <body style='margin:0px'> <div style='margin:10px'> <br /> <form method='post'> <table cellpadding='4' cellspacing='0' border='0' width='95%' class='tborder' id='optionsform'> <colgroup span='2'> <col style='width:45%'></col> <col style='width:55%'></col> </colgroup> <tr> <td class='tcat' colspan='2'> <b>Rules Manager</b> </td> </tr> <tr valign='top'> <td class='optiontitle' colspan='2'><div>Updated</div></td> </tr> <tbody id='tbody_keywords'> <tr valign='top'> <td class='alt1'><div class='smallfont' align='center'> <b> The rules have been updated for ladder ID {$rules['ladderid']}. You may wish to make an announcement on the ladder that has been updated.<br /> <br /> </b></td> </tr> </tbody> </table>"; }
  8. Thanks. Oh and as a note.. if a javascript function is added to a page.. php can call it (kinda) just echo "<script ..snip...>jsfunctionname();</script>";
  9. starting place.. http://www.phpfreaks.com/forums/index.php/topic,115581.0.html
  10. please don't bump, unless an hour has passed, yes via ajax
  11. if you need to check if its set then use isset, if you need to know if its null then use is_null.. with $_REQUEST i more often than not use isset, or !empty.. hope that helps as a note, is_null isn't the same as isset.. ie $test = NULL; isset but is also null
  12. Nice class.. i would just like to add one thing.. converting images to other formats can be a real pain (they maybe a class to do).. your probably be better of allowing a few common types, JPG, GIF & PNG
  13. Sorry, but its late and don't get paid to help here.. and don't have time to write everything for you.. create a form and read up on entering data into the database, then your have a "problem" post what you have so far and i will continue to help.. of course you can search the forum or even post in the freelance section
  14. slightly improved version <?php $pass = substr(md5(dechex(time())), 0, 10); $pass .= strtoupper(substr(md5(time()), 0, 10)); $pass = str_shuffle($pass); //Drop $pass into the database echo $pass; ?>
  15. i did the same for a password reset quick snip.. probably not the best <?php echo substr(md5(time()), 0, 15); ?> Note it only uses lower case, you can change the 15 to anything from 1 to 32..
  16. this may work better.. ie no 31 days in Feb <?php $date = "10/19/2007"; $result = "InValid"; if (preg_match('%(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}%', $date, $regs)) { if (checkdate($regs[1], $regs[2], $regs[3])) { $result = "Valid"; } } echo $result; ?> **UNTESTED
  17. Oppps thats UK this is US <?php if (preg_match('%\A(?:^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}$)\Z%', $date)) { echo "valid date"; } else { echo "Invalid date"; } ?>
  18. <?php if (preg_match('%\A(?:^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)[0-9]{2}$)\Z%', $date)) { echo "valid date"; } else { echo "Invalid date"; } ?>
  19. i think this may work.. $sql=mysql_query(" SELECT * FROM report WHERE `verdict` = '' AND (`staff1` = '' OR `staff2` = '' OR staff3` = '') AND NOT (`staff1` = 'Adminben' OR `staff2` ='Adminben') ORDER BY `dtreported` ASC");
  20. Solved ?
  21. erm.. no $target_path = "uploads/"; for a folder called "uploads" in the current directory
  22. try $target_path = "./uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); to $target_path = "./uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); echo "~$target_path~"; to see the path and check its correct
  23. http://uk3.php.net/manual/en/ref.session.php
  24. just added a debug for the server, only other thing i could see was header("Content-Disposition: attachment; filename=\"$name\""); <?php include("inc.config.php"); // we need to get the information about the file first. // we can store files in different tables. so it must be specified and ther must be a uid. $query = "select * from ".$posted['table']." where uid='".$posted['uid']."'"; $dbCon = new DBConnector(); //custom class to get a db connection $con = $dbCon->getConnection(); $result = $con->executeQuery($query); //if we got a result... //get location 'DATABASE' or 'SERVER' if($result) { switch($con->fetchResult(0,"location")){ case "DATABASE": $type = $con->fetchResult(0,"filetype"); $size = $con->fetchResult(0,"filesize"); $name = $con->fetchResult(0,"filename"); $data = $con->fetchResult(0,"content"); //Debug var_dump($type, $size, $name); die; //end Debug header("Content-type: $type"); header("Content-length: $size"); header("Content-Disposition: attachment; filename=\"$name\""); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past echo $data; exit; break; case "SERVER": //read file path from database and spit it out... if(file_exists($con->fetchResult(0,"url"))) { $type = $con->fetchResult(0,"filetype"); $size = $con->fetchResult(0,"filesize"); $name = $con->fetchResult(0,"filename"); $path = $con->fetchResult(0,"url"); #$handle =fopen($path,'r'); $data = file_get_contents($path); #fclose($handle); header("Content-type: $type"); header("Content-length: $size"); header("Content-Disposition: attachment; filename=\"$name\""); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past echo $data; exit; }else{ echo "<p>Could not find the file specified. Check that it exists.</p>"; echo "<p>File: <i>".$con->fetchResult(0,"url")."<i/></p>"; exit; } break; } } ?>
  25. Okay don't try the tests Good luck
×
×
  • 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.