Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. change $target = basename($_FILES['uploaded']['name']); echo "Trying to move " . $_FILES['uploaded']['tmp_name'] . " to " . $target; if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) to $target = basename($_FILES['uploaded']['name']); $targetpath = "uploads/"; //<---set this to the upload PATH, make sure is writeable $target = $targetpath.$target; echo "Trying to move " . $_FILES['uploaded']['tmp_name'] . " to " . $target; if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
  2. thats usful.. it doesn't work... and.. what error etc?
  3. .Net using padding, php doesn't try this check the .Net and set the padding to Zeros TripleDES tdes = TripleDES.Create(); tdes.Padding = PaddingMode.Zeros; then pad the php version $buffer = $_POST['data']; // get the amount of bytes to pad $extra = 8 - (strlen($buffer) % ; // add the zero padding if($extra > 0) { for($i = 0; $i < $extra; $i++) { $buffer .= "\0"; } }
  4. thats script looks kinda old but to add filesize check change if($ufile !=none) to if($ufile !=none && $HTTP_POST_FILES['ufile']['size'] < 25000)
  5. if(count($_POST) > 0) echo "has values"; or $v=false; foreach($_POST as $P) { if( !empty($P) ) $v=true; } if($v) echo "has values";
  6. Depends on the setup, basic idea would be add a delay for example use a captcha before the data is sent
  7. try using META Tags ie simple message echo '<META http-equiv="refresh" content="5;URL=http://www..phpfreaks.com/"> '; echo "Stuff done."; echo 'You will be redirected to the homepage page automatically in 5 seconds. or click here<a href="http://www..phpfreaks.com/"> http://www..phpfreaks.com/</a>';
  8. try this, <?php #register property // Include the configuration file for error management and such. require_once ('./includes/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Register a Property'; session_start(); include ('./includes/header.html'); require_once ('./mysql_connect2.php'); // Connect to the database. //set the variables $v= 12; $rc=456; $rn="stockies resort"; $ct="Spain"; $rg="Almeria"; $tp="T1"; $un=23; $ft="ground"; $ow="floating"; $cl="red"; $oc=12; $bk="yes"; $p=3000; $o="yes"; $t="hutchinson"; $d="fhfgfhf"; echo "<br />"; echo "$v<br />"; echo "$rc<br />"; echo "$rn<br />"; echo "$ct<br />"; echo "$rg<br />"; echo "$tp<br />"; echo "$un<br />"; echo "$ft<br />"; echo "$ow<br />"; echo "$cl<br />"; echo "$oc<br />"; echo "$bk<br />"; echo "$av<br />"; echo "$p<br />"; echo "$o<br />"; echo "$t<br />"; echo "$d<br />"; //add the property $query = "INSERT INTO property (v_id,rci_ref,resort_name,country,region,unit_desc,unit_num,floor_type,ownership,floating, occ_wk ,booked,price,available,offers,trustees,description) VALUES ('$v','$rc','$rn','$ct','$rg','$tp','$un','$ft','$ow','$cl','$oc','$bk','$av','$p','$o','$t','$d')"; #$result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); $result = mysql_query ($query) or die("Query: $query\n<br />MySQL Error: " . mysql_error()); ?> whats the error?
  9. change $query_Photo = "SELECT * FROM photos"; to $ID = (int)$_GET['ID']; $query_Photo = "SELECT * FROM photos WHERE ID=$ID"; or probably better to use: $ID = (int)$_GET['ID']; $query_Photo = (isset($_GET['ID']))?"SELECT * FROM photos WHERE ID=$ID":"SELECT * FROM photos";
  10. $str = "Hello wOrld!"; $str = ucwords(strtolower($str)); // Hello World!
  11. Use the PHP Help (you may want to add GD in the subject, ie changing colour via GD)
  12. GD is installed
  13. create a file (below) phpinfo(); upload to the server and run, you probably have the GD Lib installed,
  14. can you post some code, as an idea, what about getting the number of results and divide that by 2 then if the counter is greater than that do the other thing ie if( $recnum <= ($totalrec/2)) {echo "firstset";}else{echo "lastset";}
  15. windows or *nix? if *nix then what flavor (version) latest versions are here
  16. just an idea include_once($_SERVER['HTTP_HOST'].'/function/common.php'); include_once($_SERVER['HTTP_HOST'].'/function/header.php'); include_once($_SERVER['HTTP_HOST'].'/function/up.php'); include_once($_SERVER['HTTP_HOST'].'/function/ad.php'); include_once($_SERVER['HTTP_HOST'].'/function/seven.php');
  17. not sure what you mean, do you break out of the loop or change the conditions ? yes you can do both..
  18. on a game i wrote awhile back i created a few static maps for the low level players, after this was working i created the random ones, i assume your creating the same basic thing a MUD (Multi User Dungeon),
  19. resize code would be after this line $target = $target . basename( $_FILES['userfile']['name']) ; please see this thread as it will save me repeating myself
  20. yes it can, readup on Image Functions and rand
  21. when you upload, resize one to 200x200 and another 100x100 (whatever) then use the smaller one for the thumbnail and the larger for when the user clicks on it, can you post some code please
  22. full code <html> <body> <h3>Logon Page</h3> <form name="Logon" action="welcome.php" method="post"> <table border="0"> <tr> <td>Account: </td> <td><input type="text" name="Account" size="10"></td> </tr> <tr> <td>Password: </td> <td><input type="password" name="Password" size="10"></td> </tr> </table> <input type="submit" name="SubmitButton" value="Submit"> </form> </body> </html> <?php $a = $_POST['Account']; $p = $_POST['Password']; echo "Account:, $a"; echo "Password:, $p"; ?>
  23. change $a = "$_post['Account']"; $p = "$_post['Password']"; to $a = $_POST['Account']; $p = $_POST['Password']; please use code tags next time
  24. save the file as a copy as .phps or maybe use htmlentities(readfile($file))
  25. maybe try //new size $req_width = 320; $req_height = 240; // Get new sizes list($width, $height) = getimagesize($newname); if ($width > $height) { $req_width=($req_height/$height)*$width; }else{ $req_height=($req_width/$width)*$height; } untested
×
×
  • 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.