Jump to content

Akira

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Akira's Achievements

Member

Member (2/5)

0

Reputation

  1. Okay, so here is the deal. Have a table which stores image as blob files. Now i want to read the image width and height directly from the blob field. Is this possible and if yes, how? Things i tried so far; list($size[0],$size[1],$type, $attr) = getimagesize('image.php?i=26ddd45b02859e836d13d4b9fde34281'); print_r($size); $img = 'image.php?i=26ddd45b02859e836d13d4b9fde34281'; echo imagesy($img); image.php grabs the image from DB and show's it with header("Content-type: image/jpg"); It works for just showing the images with the <img> tag. Any ideas of help would be great!
  2. Hey freakz, Have a small issue which i just cant resolve, i want to build a recursive multidimensional array. I made a function which can read on level depts but just can't get the info in a multidimensional array. Hopefully somebody here has a anwser Function: <?php function fillRights( $id, $level) { $query = "SELECT id,nl,sub FROM tbl_rights WHERE sub = '".$id."';"; $result = mysql_query( $query ); while( $row = mysql_fetch_array( $result ) ) { echo str_repeat(' ', $level).$row['nl'].'<br />'; fillRights($row['id'],$level+1); } } fillRights( '', 0 ); ?> Table to test DROP TABLE IF EXISTS `tbl_rights`; CREATE TABLE `tbl_rights` ( `id` int(11) NOT NULL auto_increment, `nl` varchar(255) default NULL, `en` varchar(255) default NULL, `sub` varchar(11) default '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; INSERT INTO `tbl_rights` VALUES ('1', 'menu1', 'menu1', ''); INSERT INTO `tbl_rights` VALUES ('2', 'menu2', 'menu2', ''); INSERT INTO `tbl_rights` VALUES ('3', 'menu3', 'menu3', ''); INSERT INTO `tbl_rights` VALUES ('4', 'submenu 1.1', 'submenu 1.1', '1'); INSERT INTO `tbl_rights` VALUES ('5', 'submenu 2.1', 'submenu 2.1', '2'); INSERT INTO `tbl_rights` VALUES ('6', 'submenu 1.2', 'submenu 1.2', '1'); INSERT INTO `tbl_rights` VALUES ('7', 'submenu 2.2', 'submenu 2.2', '2'); INSERT INTO `tbl_rights` VALUES ('8', 'submenu.3.1', 'submenu.3.1', '3'); INSERT INTO `tbl_rights` VALUES ('9', 'menu4', 'menu4', ''); INSERT INTO `tbl_rights` VALUES ('10', 'subsubmenu 1.2.1', 'subsubmenu 1.2.1', '6'); INSERT INTO `tbl_rights` VALUES ('11', 'subsubmenu 1.2.2', 'subsubmenu 1.2.2', '6'); INSERT INTO `tbl_rights` VALUES ('12', 'subsubsubmenu 1.2.1.1', 'subsubsubmenu 1.2.1.1', '10'); My desired outcome: $rights['menu 1']['submenu 1.1']; $rights['menu 1']['submenu 1.2']; $rights['menu 1']['submenu 1.2']['subsubmenu 1.2.1']; $rights['menu 1']['submenu 1.2']['subsubmenu 1.2.1']['subsubmenu 1.2.1.1']; $rights['menu 2']; $rights['menu 2']['submenu 2.1']; $rights['menu 2']['submenu 2.2']; $rights['menu 3']; $rights['menu 3']['menu 3.1']; $rights['menu 4']; Hope some one here has a clue
  3. haha that was my first reaction as well, simply compare the to text and output and email the changes.. but the more you think about it, the tougher it gets thanks for the link though! i'll have a look!
  4. Thanks for the reply! Already doing that, but as the pages on the wiki are growing, it's hard to see the text which has been updated. Thats the problem
  5. Hey, I am building some sort of wiki page which has a lot of text on each page. Now multiple people are editing this wiki page, and if person A is editing I would like to send person B and C an email with the part of the text which has been edited. Any idea's on how to work this out? Regards, Maarten
  6. wow thanks, didn't thought about that on, but works like a charm. thanks heaps for the fast reply!
  7. Ok, I know it must be some simple thing that I am doing wrong, but just can't find it :| maybe you guys have a clue I have a basic form with checkboxes, which i store in a field with PHP's function serialize(). I view the checkboxes with the following function i wrote; function SelectCheckbox($id,$field){ $id = unserialize($id); $owner_q="SELECT * FROM $field ORDER BY name ASC"; $owner_r= mysql_query($owner_q); while ($row = mysql_fetch_array($owner_r)) { $p_name = $row['name']; $p_id = $row['id']; for ($i=0; $i<count($id); $i++) { $checked = (($p_id==$id[$i]) ? 'checked="checked"' : null); } print "<input type='checkbox' name='db[]' value='$p_id' $checked style='border:0px;'>$p_name <br>"; } } // end function So first i get the array with id's stored in the DB to match = $id= unserialize($id);. Then i do a while loop to get the names from the DB for the checkboxes + id's. And a for loop to check the id's from the array with the id's from the DB, when matched, it should echo the checkbox as checked. Now, only the last checked box is echo's as checked. What am i doing wrong here??
  8. thanks for this, checking it right away. If someone else has a suggestion as well?
  9. I have a script which i use to download an excel file, with has generated content from a database. The download always worked perfect, but since the https was activated, it doens't download at all anymore... anyone know a solution for this?
  10. thanks for your repley! I created my DB in utf-8 But don't see what it shouldn't work with <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> cause everything what i know of is set to it.
  11. Oh My **** dude, thanks, this was the stupid thing i was talking about lol By just deleting <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> in the header fixed the entire problem... your my hero dude! Thanks!
  12. Ok, should be a stupid thing i'm missing but guys, please help. Working on a german site, which have loads of special chars like for example; ü. Now, I know, by inserting that kinda text in a DB with htmlentities() function, that fixes the problem. But now, in a language file, I have this: $LANG_SITE['link']['text']='<img src="/d4/_img/icon_link.gif"> Link zur offiziellen Website des Büros der'; When i echo or print this array, the Büros part displays like: B?er Using htmlentities() doens't work, cause it mixes up the html code. What is a other work arround? Thanks in advance for any responds!
  13. Hey, You can always view a sessions contents by using following; echo $_SESSION['myusername']; And use that to select data from that person form the DB; example; $name_q = "SELECT * FROM users WHERE id='$_SESSION[myusername]'"; $name_r = mysql_query($name_q) or die(mysql_error()); So could also use; session_start(); if(empty($_SESSION['myusername'])){ header("location:index.php"); }
  14. Hey Ken, Thanks heaps for this! Added your code, and it works now Weird that this isn't well documented at php.net.
  15. When this code <?php $date = strftime("%d %B %Y",strtotime("16/06/2008")); echo $date; ?> outputs "01 January 1970 ", then I'd say you have problems hehe, nope, that code gives a nice output of 16 June 2008, like i said, no problems their
×
×
  • 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.