Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. please click solved otherwise all the helpers get sidetracked reading your question gettin ready to help you and then find out you've alrdy been helped keep the ball rolling, click solved ! And, anytime bro, if you're ever in a mess and need some help, phpfreaks is ALWAYS open and of all the forums I've ever helped on.. the speedy responses beats every other forum, hands down, I came here with a problem since the day I signed up.. and like not even 2 minutes b4 getting a response.. great forums here.. but if you have MSN you can add me, I'm just as free as PHPFreaks here aslong as its help, and not a script request.. and I'm building a contact army on MSN, so let me recruit you ~.~ RussellonMSN@hotmail.com
  2. <?php if( $_POST['perms'] ) { $perms = array(); // for all of the groups that had any checked boxes foreach($_POST['perms'] as $permgroup => $p) { $perms[$permgroup] = 0; // for each item checked in the bitfield foreach($p as $bit) { $perms[$permgroup] += $bit; } } } ?> try this, otherwise I see nothing wrong >.>
  3. will, not exactly.. but you'd need not JUST a LOOP, you'd need a recursive function which loops a single directory and everytime it encounters another directory, begin that loop on the other directories.. its a lil advanced but you could get it right if you try hard enough
  4. if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // handle the error accordingly with your other error checking // or you can do something really basic like this die('The code you entered was incorrect. Go back and try again.'); } else { include('emailsuccess.php'); }
  5. show us the whole source of: C:Program Filesxampphtdocslenixmodules est.php on line 50 but don't show us passwords etc, then we can better help you
  6. first ofall, when you start sending text, you send the headers, so right off the bat, your script isn't going to work with all that html surrounding your php code so first step up is a big one.. get rid of the html.. <?php $image = imagecreatefrompng("images/esuom.png"); if(!$image) die("Error loading image."); $text_color = imagecolorallocate($image, 13, 37, 62); $x = 100; $y = 30; $fontsize = 12; $fontfile = "fonts/VAG Rounded BT.ttf"; $text = "Hello World!"; imagettftext($image, $fontsize, 0, $x, $y, $text_color, $fontfile, $text); header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> oh.. and nice font name VAG Rounded
  7. $40 hire me *hypnotizes you* hireee meeee
  8. the only think I can say is.. open a com object within a c application or something, communicating with the scanner's dll or w.e to start listening for the scanner reading a barcode.. and then when the c application gets a scan, retrieve the scan somehow (since I never worked with a barcode scanner in my life) and then in the c program send the barcode to your PHP script and yeah lmao those ,,,,,s annoyed the hell outta me also
  9. <?php $string = "abc [TAG]<a href=\"123.com\">123</a>[/TAG] def ghi jkl mno"; $opener = "[TAG]"; $closer = "[/TAG]"; $i = '/'.preg_quote($opener,'/').'(.*?)'.preg_quote($closer,'/').'/ie'; $a = preg_replace($i,"strip_tags(\"\\1\")",$string) or die('ERROR'); echo $a; ?> although if you actually want to 'keep' those [tag]s then the preg_replace is not a very gr8 idea, coz like whenever I tried to keep them.. the preg_replace would thro itself into an infinate loop and just timeout with php
  10. includes really arn't the issue if you're including php files, but if you're allowing downloads for like special priveledged people, then you'd want THOSE files to be under your public directory, that way your members can't be jerks and link around your files to ppl who arn't paid members.. (although they could just send it to them with like MSN or w.e)
  11. yeah, what ken says, coz quoting out 's would actually throw off comparissons, and what crayon says.. that is way better, I've actually used that method b4, its also good for if () { } else { } coz then you could perform the else if the page isn't expected and throw an error
  12. I advised him to convert it to timestamps coz then I figured it would do BETWEEN with numbers rather than dates, but I guess BETWEEN works with dates aswell learned something new here aswell
  13. mysql does not use / in their dates they use YEAR-MONTH-DAY format for their dates, make sure your dates match that format and then you can simply do "SELECT * FROM tickets WHERE t_company = '{$_SESSION['company']} AND UNIX_TIMESTAMP(t_date) BETWEEN UNIX_TIMESTAMP('{$from_date}') AND UNIX_TIMESTAMP('{$to_date}')" or beforehand you could just make the timestamps prior to the query, but either way the above should work if they're in YEAR-MONTH-DAY format
  14. lol, yeah, even `ping xxx` is slow thru php on a web server, but yeah thru the command line it is very speedy.. idk if there is any way to speed up commands thru a web server. but if anybody here has any clues I'd sure love to know aswell
  15. <?php $illegal = array("'", ".", "/","\""); $find = str_replace($illegal, '', $find); ?>
  16. no.. Haku is right, that tells the browser how many bytes to expect.
  17. for content length try filesize($file) instead of a static number. could also be that the file is a bigger sized file and that would take longer that php's max timeout.. so to avoid this you could do: set_time_limit(0) at the top of the script
  18. also note, I used 'a' as the mode for the file opening, only because you might want to add more to it after or there might already be data in the file, so appent "\n" or prepend
  19. for the data that is supplied by the user, you should NEVER trust, always make your expected numbers, an actual number like so: $id = (int) $_GET['id']; any strings a user can supply, like.. username and password, you want to first check of magic quotes is on, and then if it is, stripslashes and then mysql_real_escape_string that way all the 's are quoted out so you don't have to worry about SQL injection.. includes managed by GET variables should always have something before them in the include, for example Example Request: http://yoursite.com/members.php?action=boom BAD WAY TO HANDLE: include($_GET['action'].'php'); GOOD WAY TO HANDLE: include('member_includes/'.$_GET['action'].'php'); this way they can make action = http://whatever.com/blah and hope that you do the first way, and all your script will do is look for 'members_include/http://whatever.com/blah.php'.. that will ofcourse throw an error, but way better then getting hit with a good dose of XSS
  20. sorry double post, but try this.. it should solve your problems <?php $pages = array(); $pages[] = array('home','/','Home'); $pages[] = array('events','/events/','Events'); $pages[] = array('Contact','/contact/','Contact'); $pages[] = array('join','/join/','Join'); $pages[] = array('volunteer','/volunteers/','Volunteer'); $pages[] = array('contests','/contest/','Contests'); $pages[] = array('blog','/blog/','Blog'); $pages[] = array('about','/about/','About'); foreach ($pages as $v) { if (strpos($_SERVER['REQUEST_URI'],$v[1]) !== false) $addTo = " class='active'"; else $addTo = ''; echo "<li><a href='{$v[1]}'{$addTo}>{$v[3]}</a></li>\n"; } ?>
  21. how do you get '$pagename'?
  22. I could just remake the script for you for like.. $50 and then you can have it professionally made, as I doubt anybody will help you with this, unless they're really bored, this forum is mostly to HELP ppl learn php and that code isn't even php
  23. try this: <?php $ponum = '92487'; $f = fopen($ponum.'_export.csv','a'); fwrite($f,$ponum.',1'); fclose($f); ?>
  24. no... just 1 rewrite rule
  25. there is no INSERT query, in that whole file, this can't be the correct file to help you with, but to be completely honest, this is more of a script request than help, as you personally aren't a PHP developer, and the admins are awake atm for whatever reason and will most likely move the topic to the freelance forum
×
×
  • 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.