Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. You can either pay for the service, in that case use their API, or talk to a phone provider and get the hardware setup on the server (finding an online service is cheaper in the short term, by short term i mean years)
  2. code looks ok try this <?php $filename = 'image.jpg'; $dpi = 96; if(!file_exists($filename)) { die("error, file not found"); } $image = file_get_contents($filename); echo "changed:"; echo hexdec(bin2hex(substr($image, 14, 2))) . ' ' . hexdec(bin2hex(substr($image, 16, 2))); $image = substr_replace($image, pack("Cnn", 0x01, $dpi, $dpi), 13, 5); file_put_contents($filename, $image); echo "<br> to <br>"; echo hexdec(bin2hex(substr($image, 14, 2))) . ' ' . hexdec(bin2hex(substr($image, 16, 2))); ?>
  3. opps okay change the <br /> to /n ie $msg.= $value. '<br />'; to $msg.= $value. '/n';
  4. erm.. me either.. anyways update $_SESSION['page'] = "http://" . $_SERVER['HTTP_HOST'] . "/" . $_SERVER['PHP_SELF'] . "/" . $_SERVER['QUERYSTRING'] . "/"; to $_SESSION['page'] = "http://" . $_SERVER['HTTP_HOST'] . "/" . $_SERVER['PHP_SELF']; $_SESSION['page'] .=(!empty($_SERVER['QUERYSTRING'])?"/".$_SERVER['QUERYSTRING']."/":""; should solve it, it was just some quick code
  5. i'm slightly confused by your question and include, includes a file into the code, so if that file contains php code that code will be parsedm, as if it was in that file directly.. so yes you can use an if statement, yes headers will be parserd (that means if you use Header('location: xyz.com') your be redirected to xyz.com it will not read inn xyz.com.
  6. <?php session_start(); if(!session_is_registered(myusername)) { $_SESSION['page'] = "http://" . $_SERVER['HTTP_HOST'] . "/" . $_SERVER['PHP_SELF'] . "/" . $_SERVER['QUERYSTRING'] . "/"; header("location:registration_page.php"); exit(); } ?> and update $_SESSION['myusername'] = $myusername; $_SESSION['myuserid'] = $userid; $_SESSION['myname'] = $name; $_SESSION['avatar'] = $userav; if(!empty($_SESSION['page'])) header("location:my_account.php"); header("location: ".$_SESSION['page']); exit();
  7. No thats wrong see this line
  8. basically you need to grab the details before redirecting to the login page then when the login is check redirect to that page basic example <?php session_start(); //check if the user is logged in if($isLoggedInn) { $_SESSION['page'] = $_SERVER['QUERY_STRING']; header("Location: login.php"); } ?> <?php session_start(); //blar //logged in header("Location: ".$_SESSION['page']); ?>
  9. after a quick google i found this it may help http://www.ineedtutorials.com/articles/complete-advanced-login-member-system-php-tutorial
  10. update $from ='******** <support@********.com>'; to $from ='support@********.com <support@********.com>';
  11. try this *untested* /** * Count the number of bytes of a given string. * Input string is expected to be ASCII or UTF-8 encoded. * Warning: the function doesn't return the number of chars * in the string, but the number of bytes. * * @param string $str The string to compute number of bytes * * @return The length in bytes of the given string. */ function strBytes($str) { // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT // Number of characters in string $strlen_var = strlen($str); // string bytes counter $d = 0; /* * Iterate over every character in the string, * escaping with a slash or encoding to UTF-8 where necessary */ for ($c = 0; $c < $strlen_var; ++$c) { $ord_var_c = ord($str{$d}); switch (true) { case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): // characters U-00000000 - U-0000007F (same as ASCII) $d++; break; case (($ord_var_c & 0xE0) == 0xC0): // characters U-00000080 - U-000007FF, mask 110XXXXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $d+=2; break; case (($ord_var_c & 0xF0) == 0xE0): // characters U-00000800 - U-0000FFFF, mask 1110XXXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $d+=3; break; case (($ord_var_c & 0xF8) == 0xF0): // characters U-00010000 - U-001FFFFF, mask 11110XXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $d+=4; break; case (($ord_var_c & 0xFC) == 0xF8): // characters U-00200000 - U-03FFFFFF, mask 111110XX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $d+=5; break; case (($ord_var_c & 0xFE) == 0xFC): // characters U-04000000 - U-7FFFFFFF, mask 1111110X // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $d+=6; break; default: $d++; } } return $d; }
  12. read up on MySQL and Cookies
  13. we would need to see more code as that would run, without a refeash
  14. you can use JS, HTML or PHP the PHP one is header("Location: newpage.php");
  15. Okay well the imagesize is working you can create a php file to resize the image OR use HTML try something like this $filename = "/dev/albumart/watershed.jpg"; if (file_exists($filename)) { list($width, $height, $type, $attr) = getimagesize($filename); //find the larger size if($height > $width){ $size = "height=\"50px\""; }else{ $size = "width=\"50px\""; } echo "<img src=\"img/flag.jpg\" $size alt=\"flag\" />"; }else{ echo "<img src=\"img/noflag.jpg\" height=\"50px\" alt=\"missing flag\" />"; }
  16. lets try something $filename = "/dev/albumart/watershed.jpg"; if (file_exists($filename)) { $avar = getimagesize($filename); }else{ die("No file"); }
  17. ahh i see you can not concat a function.. try this <?php $to = $email; $subj = "PESDC Booking Confirmation"; $msg = $_POST['dbemail']; $msg.= "\n --------------------------------------------- Name: $name E-mail: $email Morning: "; foreach($_SESSION['am'] as $key=>$value) { $msg.= $value. '<br />'; } $msg.="Afternoon:<br>"; foreach($_SESSION['pm'] as $key=>$value2) { $msg.= $value2. '<br />'; } $header = "From: confirmation"; $mailsend = mail($to, $subj, $msg, $header); ?>
  18. it means file not found, does "/dev/albumart/watershed.jpg" exist ?
  19. whats the problem ?
  20. try <?php $lines = file("data/options.DAT"); $K=0; $last = count($lines) - 3; foreach ($lines as $line) { $K++; $data[$key] = explode("|", $line); $name = trim($data[$key][0]); $pid = trim($data[$key][1]); if($K >= $last) print "$name - $pid<br />"; } ?>
  21. The problem you have is to do with account access, PHP is running from the System account so notepad is launched from the System account, what you need to is change the logon account for the APACHE service, to do this go Start -> Run type services.msc fine APACHE and double click Select the Log On Tab and change to 'Local System Account' & Allow services to interact with desktop this should now load up notepad with the current user profile. you may also try exec('start notepad.exe');
  22. untested <?php if(isset($_POST['Test'])) { echo $_POST['Test']."SELETED<br>"; } $sql = "SELECT * FROM `table` ORDER BY `id` ASC"; $result = mysql_query($sql) or die (mysql_error()); //echo "<select name=\"\" id=\"\">"; echo "<form action=\"sum.php\" method=\"post\">"; echo "<select name=\"Test\">"; //ADDED while ($row = mysql_fetch_array($result)){ extract ($row); echo "<option value=\"$id\" OnChange=\"submit();\" > $name - $cmd - $StartDate - $t_letter_code_ef </option>"; }//Ends while echo "</select>"; echo "<br>"; echo "<br>"; echo "<input type=\"submit\">"; echo "</form>"; echo "<br>"; echo "<br>";
  23. the problem is here if ($_POST['action']=="save") { as theirs no post this will fail.. and theirs no if so.. nothing will display.. what are you expecting?
×
×
  • 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.