Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. What do you mean by labelling them?
  2. Small modification (looks nicer and is smaller): [code]<?php session_start(); $con = mysql_connect("localhost","ZackBabtkis","") or die('Could not connect: ' . mysql_error()); mysql_select_db("test", $con); $subject = mysql_real_escape_string($_POST['subject']); $message = mysql_real_escape_string($_POST['message']); $date = date("F j, Y, g:i a"); $sig = isset($_POST['sig']) ? "yes" : "no"; mysql_query("INSERT INTO messages (Username, Sender, Subject, Message, Date, sig) VALUES ('{$_COOKIE['user']}','{$_SESSION['username']}','{$subject}','{$message}', '{$date}', '{$sig}')",$con)) or die('Error: ' . mysql_error()); echo "Your message has been sent to {$user}"; mysql_close($con) ?>[/code]
  3. I voted back since I suck at designing (front).
  4. PS3 comes with either a 20gb or 60gb hard disk as well :P
  5. Use percentages instead.
  6. No, but that doesn't matter. A tab is a tab, but in different editors it is presented different. Sometimes it might be 2, 4 or 8 (or user configurable), but a tab is still = \t But it is much easier to just write \t if the editor support it.
  7. Else you could just copy a tab and paste it into the replace field.
  8. Quite funny in the start, but I got bored half-way.
  9. This is off-topic, but well... HuggieBear: Instead of [nobbc][b][[/b][b]code][/b] ... [b][[/b][b]/code][/b][/nobbc] you can just type: [nobbc][nobbc][code] ... [/code][/nobbc][/nobbc] ;)
  10. I always put them in curly brackets. I think that [code]"Bla bla {$variable} bla bla again"[/code] looks nicer than [code]"Bla bla $variable bla bla again"[/code] It also makes it easier to spot variables.
  11. Yeah. You can use $_SERVER['HTTP_REFERER'] to find out what page that linked to it. (I bet it wont take very long before somebody come and tell that it can be spoofed)
  12. Put them in an array like this then replace them: [code]$smilies = array( // code => image ':)' => 'smile.gif', ':D' => "smile2.gif', ':(' => 'sad.gif', ); $codes = array_keys($smilies); $the_text = str_replace($codes,$smilies,$the_text);[/code]
  13. Try TinyMCE.
  14. Of course. First line assigns <album to $output. Then you run through each POST variable and add it to output, then you add the ' />' to close the tag. Finally it is echoed.
  15. This should do it: [code]if(filemtime($file)+24*3600 > time()) { unlink($file); }[/code]
  16. Try something like this: [code]$output = "<album"; foreach($_POST as $key => $value) { $output .= " {$key}=\"{$value}\""; } $output .= " />"; echo $output;[/code]
  17. Just use the [url=http://php.net/mail]mail[/url] function.
  18. Ahh, well ok I see.
  19. You could make an anti-leech system.
  20. SVN repositories store all revisions of all files so you always can see what user changed what and you can always roll back any changes made and it is therefor awesome for development purposes. Actually there is GUI SVN applications. Linux: [url=http://meld.sourceforge.net/]Meld[/url] Windows: [url=http://tortoisesvn.tigris.org/]TortoiseSVN[/url]
  21. No. A keygen generates a serial/key that would work. You need to keep the way you generate the key secret, so you could do this: - User input serial in config file - Each time the script is run it will open a connection to http://your-site.com/check_key.php?key=bla bla bla - check_key.php on your server will check if the key is valid (and possibly if it is in your customer database). It will return e.g. 1 if it's valid and 0 if it isn't.
  22. [quote author=techker link=topic=111105.msg450096#msg450096 date=1160505500] so it would look like this? [/quote] Yes. [quote author=techker link=topic=111105.msg450096#msg450096 date=1160505500] can't see your php block? [/quote] The block of PHP code.
  23. I guess it would work. But it would be very easy to make a key generator and thereby be able to register the script without a serial from you.
  24. Multiply: [code]$var1 * $var2[/code] Addition: [code]$var1 + $var2[/code]
  25. If you can do one table, then just do this: [code]$query = mysql_query("SHOW TABLES FROM db_name_here"); while($table = mysql_fetch_row($query)) { $table = $table[0]; // do your stuff here }[/code]
×
×
  • 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.