Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. You'll need to use regex or str_replace to create newlines after each tag.. such as.. replacing '<head>' with '<head><br/>\n'.
  2. What error does it exactly show you? You may want to use FileZilla to force hidden files, remove the old PHP file from apache and retest. To be curtain as well, enter the url and ... whatever.php? with the question mark, to make sure it'll not use cache.
  3. Well look up some JS to add the form. in each for you need to have value = something different.. such as 'email1', 'email2', 'email3' and on your PHP side you can do.. if (isset($_POST['mail1'])) { mail(....) // mail to this address } if (isset($_POST['mail2'])) { mail(....) // mail to this second address } etc..
  4. what is exactly your trouble? You're not telling us any errors or problems that you're having, it isn't so helpful.
  5. Very simple function.. Here you go. $text = "12345678910"; $var = substr($text, 0,; echo $var; //outputs 12345678 Look up substr for more info on the function. You can even go as simple as: $text = substr($text, 0,;
  6. Well first brush up on your SQL skills as you'd need a database to store the messages, to save the need for insecure files.. in the PhP part you can catch what they write with $_POST['message']; etc, and you could add it to database under their user name, and create a user under something like... user.php?u=20 for them to view all their messages, pulled from their database's user name.
  7. I'm not sure the encoding would mess with it. If you're really wanting to fix that, if that is the problem.. try.. $html = utf8_encode(file_get_contents('www.example.com')); And that should fix the encodings as it's coming along.. But how about you jack the max execution time via php.ini or .htaccess? You can finally debug how long it is taking, or if it is NOT connecting at all to that server. CURL would be a better option as you can define ports and change the connection timeout variable, you can tinker to see how long it really takes..
  8. Use a FOR loop to iterate through the variables.. within the for loop, you'd put something like.. <td><<? <table..> <?php for( $i=1;$i<=20;$i++) { echo "img src=$row1line$i"; ?> alt="" name="Row1Line1" width="50" height="50" id="Row1Line<?php echo $i; ?>" /></td> <?php } ?> To be honest I'm not sure if $row1line$i would work, you may have to use eval() or some trick.
  9. I'm not sure what you're trying to do.. You can do $var1, $var2, $var3 = 'this'; If you mean combining them together, yes, use the fullstop.. $var 1 = 'a'; $var2 = 'b'; $var1.$var2 //outputs 'ab' Or create a variable out of the rest.. $varc = $vara.$varb Don't know what you're meaning though..
  10. Well then you'd use JS to add a form, such as .. <a href="#" onClick="addForm()">Add form</a> Make sure your JS adds a new property.. such as value="mail2" or mail3 according to how many fields are being aded, so PHP can distinguish them and mail each address accordingly..
  11. You don't need to add more e-mail fields, it's slow, unconventional and hard to write. The user only needs to add.. 'user1@example.com;user2@example.com'. e-mail or e-mails separated by semicolons, the explode function will separate them. This is what all websites do..
  12. My method is more simpler, separated by ';' as that is a standard of most e-mail clients.. $to = $_POST['email']; <---, if there is more than one when it it'd be exploded, then create a function to send e-mails to each one through a for loop, simple enough. explode simply makes.. 'me@hotmail.com;this@gmail.com' into an array.. $to[0], $to[1] or whatever.
  13. What do you mean using JS?? You can make them enter something as this, which all the sites i've seen use.. "Enter e-mails you want to send to, separated by ';' ".. me@hotmail.com;jason@gmail.com;this@site.com -> $e-mails = explode(';', $_POST['e-mailfield']); And then there you go! You've got an array with each number, you could easily iterate through the array and use mail() with each address until the for loop ends.
  14. I'd recommend just trying this code to see if it works on your server to test if everything is working alright. Your server's DNS may be malfunctioning or the website.. physically.. example.com may not have a corresponding IP that can be parsed. $ip = gethostbyname('www.google.com'); //Returns 74.125.127.104 for me. echo $ip;
  15. I just tested grabbing that site and it works fine, it may be a problem with your server being able to reach that site.. I'd recommend using CURL for this as it requests the page with headers instead of physically gets the page contents.
  16. Should be 4MBs default with apache, but mine is 10 with WAMP..
  17. Make your WWW folder read/write/execute in properties if available, and you'd use something such as mkdir to create a folder.. such as.. mkdir("../logins/$username/"); file_put_contents('../logins/'.$username.'/'.$username.'_type_username.txt', 'Done'); That might work.. You should type \n, not /n if that was your mistake
  18. $ip = $_SERVER['REMOTE_ADDR;']; //Code provided by Ignace echo "Your IP is: $ip"; You don't need to credit my work everything I do is open-source But I wonder what happens if someone would post code that is copyright protected? The forum won't be held responsible so the poster is? Oh my! Copyrighted code does not need credit, as it's illegal to copy it in the first place?
  19. I'd recommend using an SQL database to store files.. if you're wanting to put data into a flatfile then follow a tutorial like this with fread/write.. http://www.xentrik.net/php/flatfile.php
  20. $ip = $_SERVER['REMOTE_ADDR;']; //Code provided by Ignace echo "Your IP is: $ip";
  21. You need to set your permissions for folders to be written to, such as 777.. but this just shows you how unsecure your method is.
  22. Use fread and fwrite instead of file_put_contents first of all to be able to write to the same file.. and use my code above to create a new folder per user.. It's basic but you get how it's done, just with the slashes.
  23. This is a dangerous way to collect user information, Why are you doing that , especially each user having 4 files for such little information? You're not even asking a question, what is it you want us to help you with? If you're wanting to create a new folder.. file_put_contents('../logins/'.$username.'/'.$username.'_type_username.txt', 'Done');
  24. Wtf? Zend is the framework PHP runs on, it's what interprets the code, use Zend Optimizer to compile it. I would not trust anything else.
  25. There is no settimeout in php, you could use the output buffer to display 'hello' before the sleep() cycle is finished, but it's buggy and is not a good solution. I had another example for another thread on this topic.. but try this code.. place it at the top of your page, ob_start() has to atleast. <?php if (ob_get_level() == 0) ob_start(); echo "Hello"; echo str_pad('',4096)."\n"; ob_flush(); flush(); sleep(5); echo "world"; echo str_pad('',4096)."\n"; ob_flush(); flush(); sleep(0); ob_end_flush(); ?>
×
×
  • 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.