Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. Well for starters. Your code is wrong for the HTML, It puts an X because it's invalid markup! "<img src="[localhost]; " Needs to be <img src="http://127.0.0.1/chart.php"/>
  2. No, All you need to do is stop the pre-existing apache/MySql processes (preferrably disabling them) And install that. It'll allow you to start them separately from your pre-existing applicastions, but they're all linked for security and portability. No worries about conflicting. (On Linux and Windows it works excellent that I've done, Mac is based on Unix, so It'll be alright) EDIT: I was playing Soul Calibur IV on PS3 for the last hour, lol, on and off there're lots of people here, guess not right now. EDIT 2: This is kinda an apache installation question, dunno if the installation forums have active people, atleast it's answered.
  3. If you're unable to install that, than I'd really recommend you start with something easy: http://www.mamp.info/en/index.html It's Apache, MySQL and PHP linked and prepared to be installed. Should help you out alot more. You can start SQL as a service.. 'mysql start' etc.
  4. Still not recommended. If you're going to be portable at all, and compatable you'd use full opening tags. Try this: <tr><td><?php echo $v["url"]; ?> __bxhref="<?php echo $v['YOUR VARAIBLE NAME HERE!!!!!']; ?> " title="<?php echo $v["name"]; ?></td></tr>
  5. Do you mean you wish to add the formmailer variables (such as paypal_id) to database? Or simply add the code together? Add the Database (and any session components) to the top, and check for any variables that are interfering. BUT. You can do something even simpler and just include it. Formmailer.php: <?php include 'database.php'; //your first file //Then rest of your code here, you can pull data from database or insert into..
  6. https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=408 I'm sure there are better resources, even not comodo specific. Use a search engine.
  7. Can you not just extract the extension and validate it through that way? And if it were uploaded with Imageshack.us, I'm sure their serverside filtering has done the job for you.. If I get what you're asking. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } It won't allow for dynamic images, and you can only allow certain extensions once you validate them.. If you're paranoid than you can do something like this. Download the image or link to it and: exec("identify $fullpathtoimage",$out); //using system() echos STDOUT automatically if(!empty($out)){ //identify returns an empty result to php //if the file is not an image $info = $out[0]; $info = explode(' ',$out[0]); $type = $info[1]; if($type == 'JPEG' || $type == 'GIF' || $type == 'PNG'){ return true; } } And it'll return something such as "./image/someimage.jpg JPEG 150x112 150x112+0+0 DirectClass 8-bit 4.54688kb"
  8. There isn't. As the previous user posted, go into a command line you have (preferrably Windows for this command) and type: Telnet mail.yourdomain.com 25 Or whatever your mail server is. If it is unreachable or times out, than obviously that is the problem.
  9. This will refresh the page, if they're entering a comment or not (cutting their scrolling/writing off). OP, I'd look into using AJAX to refresh the comments, without a physical page refresh. If that is what you want to accomplish, it can be done simply with only JS. Lots of tutorials online.
  10. Hashing cannot be reversed, technically. Adding salt will remove the attacker's ability to use Rainbow tables (precalculated hash attacks basically) on the hash. It's faster and recommended to use hashing, much faster than decrypting. <?php $password = 'mypassword'; $salt=')_*]$'; $saltedHash = md5($pass . $salt); echo $saltedHash; ?> When the user enters his password, it rehashes it, sends it to the DB and checks if the password hashes are the same. Straightforward from there. if ( (md5($_POST['...']) . $salt) == xxxxxxxxxxxxx ) {//hash from database //so on.. allow them to change their pass. }
  11. Create a file named .htaccess in your web root with this to make sure your server isn't limiting file upload size: upload_max_filesize php_value post_max_size 30M php_value upload_max_filesize 10M Or modify PHP.ini and place those values in yourself. Also, note 2.5MBs is larger than 2,500,000 bytes. 1024x2500 = 2,560,000..
  12. You can use str_replace, A really simple function and can simply replace 'groups' with 'organizations', and 'group' with 'organization', retaining the plural syntax. $phrase = "Organizations you own, Your organizations, Create a new organization"; $old = array("group", "groups"); $new = array("organization", "organizations"); $newphrase = str_replace($old, $new, $phrase); echo $newphrase; //Should be what you want it.
  13. Your method uses referrers, which can be spoofed and are not reliable, nor required to be set by the client. Sessions are what you are looking for, then you have to initiate the session (by NOT going directly to the url) and then if you are authenticated, allow access.
  14. From the look of it, you do not have sessions. You should start the session on the login/resid entering page and it will carry over to the other page. If $_SESSION['logged_in'] is false for example, You can redirect them to a login page and disallow access via an IF statement or otherwise.. Just to note.. Someone may be able to directly access the SWF itself, by copying the source of it and entering it, bypassing PHP all together (since it's a resource), I'm not sure what your SWF actually contains but if it's important than you should add checks to that as well, or disallow access except through the page.
  15. There might be code people have already written out in the wild, Or even an API. I'd google it. I'm sure there's info on how to get user info online.
  16. Try adding the -f parameter to your mail() function like so: $message = 'Hi There'; $header = 'From: myemail@gmail.com'; //From header is must $subject = "Feedback Form Results"; $send=mail("myemail@gmail.com", $subject, $message, $header, '-fmyemail@gmail.com'); No space between the -f and 'from' e-mail address forced. Also note that port 21 HAS to be opened, it's an invalid recipient if it's not reachable! EDIT: You cannot use or Die on a variable. Write: if (!$send) { die('Mail error'); }
  17. I doubt anyone will write such a pointless function, but you can start with a regex tutorial here: http://www.phpro.org/tutorials/Introduction-to-PHP-Regex.html And here's a start to your function: function GrabInfo($myspaceID) { $contents = file_get_contents('http://www.myspace.com/users/' . $myspaceID); //Or wherever myspace users are.. preg_match('#profi....'); //The fun part!, you can match off $contents which is the source of the myspace page. }
  18. Works perfectly, and I learned a thing about strings! Thanks.
  19. I have a hash that is 32 characters long, it's concatenated after another string which is of variable length. How do I extract anything before the end 32 characters? "$string . md5(...);" is what I have to give a clearer picture. I've tried everything with string manipulation and couldn't find a fully working method.. I can't find what just $string is.
  20. Yeah. Why do you have exits anyway? You just need to find a workaround with your logic and maybe use IF's to stop output rather than using exit() to destroy the output. Then you can work from there and add an include() for a footer.
  21. I'd recommend downloading an older version of jQuery, No loss and it may fix your problem. I've not seen this problem happening, and my (old) IE 6.0 works fine with it.
  22. You don't need curl.. but you're not even pulling the data from it. $url = file_get_contents('http://api.bit.ly/shorten?version=2.0.1&longUrl=http://www.ideatoceo.com'); json_decode($url); //Or whatever API specifies..
  23. Only thing you'd need to watch out for is XSS, which relates to problems with javascript. The IMG tag will just output a resulting image if it is supported, such as mimetype image/jpg(gif/png/xmp/)
  24. Why are you even doing this? The image tag is for an image, if you didn't know, and the browser will only render it as so. If that would allow redirecting the bloody web would be 1000x as spammy than before. Page2.php can redirect to http://www.example.com/image.jpg.
×
×
  • 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.