Jump to content

acdx

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by acdx

  1. http://home.acdx.net/g/index.php An instant deployment image gallery system by me. Admin username: admin Admin password: admin This instance of the gallery system exists to demonstrate the features of the system. Feel free to try out the commenting, rating and admin features, but no profanity or vandalism (annoying stuff) please.
  2. Thank you, I'll have to try that out. Obviously I do proper markup, the demo file was just an "excerpt".
  3. Floats interact with eachother and thus position: relative won't do it. I want to do this: [url=http://acdx.net/divs.php]acdx.net/divs.php[/url] (see source) But specify the position of the child divs relative to the upper left corner of the parent div instead of the document bounds.
  4. I have a container div with specified width and height, inside which I have a few other divs, with specified dimensions as well for that matter. I'd like to be able to position the child divs freely relative to the upper left corner of the parent div. Sounds really simple, but I haven't found a way to do it. position: absolute won't do, as I need to be able to position the divs relative to the parent div, not the page bounds.
  5. [quote author=Barand link=topic=110069.msg444235#msg444235 date=1159626156] Change if ($album="main") to if ($album=="main") [/quote] I love programming..
  6. I'd suggest you simply add a "last login time" (datetime?) and a "last login ip" (varchar) column to your user table, defaulting to NULL. When someone logs in, "update users set logintime = xx, loginip = xx where id = xx". It's not like the users are gonna "go back to their old ip" anyway.
  7. [quote author=tomfmason link=topic=109896.msg443402#msg443402 date=1159488686] Are you having issues [/quote] QFE
  8. printf: 1. Find appropriate material to scan 2. Take the sheet of paper in your hand 3. Lift the scanner cover 4. Place the paper on the glass facing down 5. Close the scanner cover
  9. How do you know whether a user is logged on or off anyway?
  10. Not possible without special applications or browser plugins installed by the user.
  11. You might have to set up some permissions first to allow access to the database from the remote domain.
  12. And even if that weren't possible.. [code]<?php function update_property($property, $value) {   $this->$property = $value; } ?>[/code] EDIT: Correction
  13. You could store a serialize()d php array as a string in the database, but then you would have to do most of the work in PHP anyway. Heck, you could just as well store a pipe-separated string of values in the db and explode the string in php.
  14. Something 8) Also, see [url=http://php.net/strtr]strtr()[/url]
  15. You could put in some keyword and replace it with variables when printing. Let's say you put "<p>LOL</p><p>LAL</p>" in the database then when printing the string [code]<?php $replace_pairs = array("LOL" => $i, "LAL" => $j); echo(strtr($string_from_database, $replace_pairs)); ?>[/code] Or sth
  16. No. What happens there is the php code simply gets sent to the visitor's browser instead of being evaluated by the server. You can't do this either: [code]<?php echo("<?php echo('boo'); ?>"); ?>[/code]
  17. What's the problem with using header()? Also, you could simply use the form page itself to process the form data. You're missing some quotation marks there btw.
  18. [quote]it could work for the ban system but l would rather have it to display how many days they are banned for[/quote] Assuming you have a table called "bans" with columns (INT id,) INT user and DATE ban_ends, this query returns the remaining ban days as "days_left": [code]SELECT DATEDIFF(ban_ends, CURDATE()) days_left FROM bans WHERE user = xx;[/code]
  19. Even better is: [code]<?php $query1 = mysql_query("select * from members where month(dob) = month(curdate()) and day(dob) = day(curdate())"); ?>[/code]
  20. On a side note, there are much easier ways of doing this. You could write the ban ending date into the database in a DATE field and later compare it with the current time. If the ban ending date is in the future, the user is still banned.
  21. Read this: [url=http://php.net/manual/en/ref.mysql.php]http://php.net/manual/en/ref.mysql.php[/url] This wouldn't hurt either: [url=http://php.net/manual/en/function.require-once.php]http://php.net/manual/en/function.require-once.php[/url] ;) You first need to establish a connection to the mysql server using mysql_connect(). Then you select the correct database using mysql_select_db() and execute your query using mysql_query(). Then process its return variable using functions like mysql_fetch_assoc(). Finally close the connection with mysql_close().
  22. [code]<?php setcookie("cookie", $value, time()+31556926, "/", ".website.com", 1); ?>[/code] By setting "secure", the last parameter in your call, 1, a secure HTTPS connection is required for the cookie to be set. [quote="php.net"]Secure: Indicates that the cookie should only be transmitted over a secure HTTPS connection. When set to TRUE, the cookie will only be set if a secure connection exists. The default is FALSE.[/quote] so simply make it [code]<?php setcookie("cookie", $value, time()+31556926, "/", ".website.com"); ?>[/code]
  23. Instead of [code]<?php $result = mysql_query("INSERT INTO classes (dayname, day, month, year, title, description, cost, location, contact) VALUES ('$dayname', '$day', '$month', '$year', '$title', '$description', '$cost', '$location', '$contact')"); if (!mysql_query($SQL,$con)) { die('Error: ' . mysql_error()); } ?>[/code] ... make it [code]<?php $result = mysql_query("INSERT INTO classes (dayname, day, month, year, title, description, cost, location, contact) VALUES ('$dayname', '$day', '$month', '$year', '$title', '$description', '$cost', '$location', '$contact')") or die(mysql_error()); ?>[/code] Also check out these links [url=http://php.net/manual/en/function.mysql-query.php]http://php.net/manual/en/function.mysql-query.php[/url] [url=http://php.net/manual/en/function.exit.php]http://php.net/manual/en/function.exit.php[/url] (aka die())
  24. Ah.. I think what happens is special characters come over as html codes and get converted yet again by htmlspecialchars when printing into the textarea..
×
×
  • 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.