Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. And e-mail form makes sense, But what do you mean by application form? What is the application needing to perform or make use of? As it seems you know not much of PHP I'd recommend you don't stress yourself on such a project with no knowledge on how to do it, like Thorpe said..
  2. Please place your code within tags for easier reading. What is line 69? From the looks of the error you're missing a semicolon or an extra bracket, but it'd help if I had the exact line.
  3. Yes, as a browser is a client (and PHP is serverside) JS is required to achieve this. Such as this function (Not every browser allows this, but FF>2 and IE7+ does), Note you will need to use an AJAX technique to call the logoff function: < body onbeforeunload="alert('Closing');"> I'm sure there are other methods available if you search them. As for your second question, what are you evaluating? What are you wanting to do? and what is an example scenario? I'm sure with preg_match you can find a number out of a string, but there may be a simpler method.
  4. What is the error mysql_error() gives you? That'd be helpful.
  5. What are you trying to do? $nextlessonnum = 123; $lesson = 'Lesson'; $zip = '.zip'; $newfile = $lesson.$nextlessonnum.$zip; echo $newfile; //Output: Lesson123.zip That works fine. Concatinating strings and numbers are the same. http://php.net/manual/en/language.types.type-juggling.php
  6. WAMP = Windows Apache MySQL & PHP, To my knowledge an SMTP server would not be installed along with it. You'd need to install it separately or use a paid hosting's account. EDIT: If you really wanted to find out if you had it or not, Go into command line and type "telnet 127.0.0.1 25", and if it does not connect there's nothing accepting the SMTP port.
  7. How does it not work? If you look at a sample of the code: $string = 'abcdefghijklmnopqrstuvwxyxz'; //long string //[snip]// $shortdesc = shorten($string, 5); It'll output exactly: 'abcde...' How are you implementing it?
  8. It should be the same, Most webhosts allow you to use .htaccess to change values for php without the need of editing the master php.ini, Else you can use this function at the top of your script: ini_set
  9. This should do the job more or less: $string = "Bla bla bla bla bla bla bla bla bla bla bla bla bla"; function shorten($string, $length) { if (strlen($string) > $length) { $string = substr($string, 0, $length)."..."; } return $string; } $shortdesc = shorten($string, 300); echo "$shortdesc"; //Outputs something 300 characters then ... EDIT: I'd recommend you look at strlen and substr they're handy string functions, if you know how to use them.
  10. Obfuscation is worthless for security, but I'd obviously bet you 95% of your clients would not take the time to browse timelessly through the script and attempt to view where the code is. You can add this: (your original message) echo '<script language="Javascript">document.write(unescape(\'%3C%64%69%76%3E%50%6F%77%65%72%65%64%20%62%79%20%3C%61%20%68%72%65%66%3D%22%68%74%74%70%3A%2F%2F%6E%65%62%61%6C%61%2E%63%6F%6D%22%3E%4E%65%62%61%6C%61%2E%63%6F%6D%3C%2F%61%3E%3C%2F%64%69%76%3E\'))</script>'; Or using JS escapes, base64_decode on an already coded string etc.. They'd look inconspicuous enough for most people. It's only a brandmark. EDIT: Fixed code.
  11. Yeah, there's just not much PHP can grab (from UA or servervars) that hints that the client has JS or not. It's an unfortunate thing, but heck even cellphones have that support, so you can safely say only people with No-Script would not be able to view your page, but then again, if they knew what no-script was they'd disable it for a video/flash/js page.
  12. Another blabbering idiot... You did nothing right and blatantly didn't read any guidelines for posting questions on this board. You're lucky you even got a decent response. Go back under the bridge you came from, we don't have time for trolls like you, LOOSER!! That is what I believe is called, 'feeding the troll' But I do find it funny, the original thread, he sure snapped somewhere. Good watch.
  13. Yes, if the 'userCakeUser' session variable is the same as what it'd be in the database.
  14. Change $pos = strpos($friend_content, ($_POST['fcode']); to: $pos = strpos($friend_content, $_POST['fcode']); There seems to have been an error when the code was written, that is line 7.
  15. The above is another method of passing the variable into another, but as for your original question you should do something like this: ${"byesleft_user_".$i}
  16. What you're doing is looping with the same generated variable. You must encorporate the random generation within the loop, so it is truly random each time, you can achieve this by placing your 'while' loops that calculate the random pre/suffixes into functions, and call them in the loop.
  17. Hmm.. The connection should not time out unless there is a massive amount of data being pulled , or an error with your server. But why are you using file_get_contents? All this does is puts an extra HTTP request through your server to display something that's already on it, you can try: include('../aafiles/php/header.php'); That, (in ideal conditions) is impossible to time out, as it accesses the file from disk not HTTP.
  18. PHP is a serverside language, and , in this case it may be a much better solution to use Javascript as it can detect if there is flash or not. I'd recommend using SwfObject, as it can provide you a simple solution to detect and display the swf file, else display something else.
  19. Why not use array_rand instead of shuffle? .. Anyway, Your second script seems to list the domain: Can you not just run that through a FOR loop and list a random domain 10 times? (prefix and all) There's not a need for a function like 'showSuffix()' as it doesn't append the prefix, it'll just get in the way.
  20. The function strip_tags can only strip tags enclosed within angular brackets ( < , > ). Maybe you can use the following example to strip those types of tags, I'm not sure if it fully works though: <?php $String = "[b]Bold[/b] [u]etc.[/u]"; $String = preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $String); echo $String; //Returns: Bold etc. ?> EDIT: Updated the code, it should work now.
  21. Pleas add this code after the first <?php tag: ini_set('display_errors',1); error_reporting(E_ALL);
  22. Why are you stripping slashes for output? So you are aware, It is \r\n, the scape for carriage return and newline. If you strip the slashes, it will NOT parse as a new line and will simply display as 'rn' <tr><td colspan="3"> <textarea name="stg" rows="2" cols="120"><?php echo trim($formVars["stg"]);?></textarea></td> </TR>
  23. That code works fine, But I made it more dynamic ( in case you're wondering something like): while ($exp >= ($exp % (60*(1.2*$level)))) { $exp = $exp - (60*(1.2*$level)); $level++; if ($exp < (60*(1.2*$level))) { break; } echo "<br/> Reached level: " . $level . "<br/> " . $exp . "\n\n"; } Not sure if it's the best of ways, but it dynamically increases the amount of EXP needed to level up, and displays the current exp/max as so. It's perfect for my game..er.. concept of a part of a game. A loop is required for the obvious dynamic part of it!
  24. Yes, replace your credentials with x's and show the whole code in case you presented an error (ie. invalid characters within string). What I'd recommend is just going into your panel and triple check your username for the sql not the specific sql database
×
×
  • 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.