
dennismonsewicz
Members-
Posts
1,136 -
Joined
-
Last visited
About dennismonsewicz
- Birthday 02/03/1987
Contact Methods
-
AIM
noosemonsewicz
- MSN
-
Website URL
http://www.dennismonsewicz.com
Profile Information
-
Gender
Male
-
Location
Nashville, TN
dennismonsewicz's Achievements

Advanced Member (4/5)
0
Reputation
-
Ah that makes sense! So my 2nd example is stating the $var could be an array, right?
-
Can someone explain the difference between the following? function a(array $var) { } function a($var = array()) { } function a(Array $var) { } I have seen these recently in a script I am modifying, but not 100% sure as to what each one does. Well I know what the middle one does, but am a little confused on the 1st and 3rd one. Thanks! Dennis
-
I am trying to create a script that will show a block of images for every nine items in an array. So it doesn't need to show the block of images for every 9 items, but every time the counter hits 9 show a block of images. Make sense? I am stumped as all get out. Thanks for all the help in advance!
-
bump
-
Ok I think I know what I need to do... Its the way a jquery slider is setup... there is an unordered list that has to have 9 items per list. So I have to figure out a way to show blocks of unordered lists with 9 items per.
-
And what is the difference between ++$i and $i++?
-
Wow thats a lot closer than what I could have done tonight! Thanks man! Now its cutting off at 9 images but not continuing the foreach loop to show the rest of the images.
-
Ah gotcha... I just tried it and thats right... I am just trying to show 9 images at a time because of a photo gallery I am working on. Its built to show 9 at a time, but if there is more than 9 then a sliver of the 10th image appears on the page... I just need the script to break at the 9 and then show the next set of 9 images.
-
Hmmm what would I do instead of using a for loop?
-
I am working on a photo gallery script in which I need to show 9 images at a time. Here is my script so far <?php foreach($pictures->result() as $p): ?> <?php for($i = 1; $i <= 9; $i++) { ?> <div class="item"> <ul> <li><a href="images/gallery/<?=$p->category;?>/<?=$p->photo_name;?>" rel="example1" ><img src="images/gallery/<?=$p->category;?>/thumb_<?=$p->photo_name;?>" alt="#" /></a></li> </ul> </div><!-- end item --> <?php } ?> <?php endforeach; ?> At the moment the script is showing one image at a time 9 times and for every entry in my database. I have been battling this for a little while now. Thanks in advance for all of your help!
-
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
RHODESA YOUR A GENIOUS! I took the code out of the switch and placed in another file called excel.php and then linked over to it and it worked! There was something happening in the switch Everything works like a charm now! You ROCK! -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
I even had a coworker go to the exact link and on a windows machine using Office 03 and still is having the same problem -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Ok... I clicked your link and was able to open it. I updated the PHP script, and still the same problem. I did notice this though: When I click on my link and try to open it, Excel displays this message: But when I click on your link it works and does not display the above message -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
Sure here is the code I am using: The following is my code in my switch case "export": include "../includes/db_login.php"; include "excelWriter.inc.php"; $excel=new ExcelWriter(); $myArr=array("Id","Product","Company","Description","Web Address","Last Used","Where product was last used","Is product active or inactive?"); $excel->writeLine($myArr); $query = "SELECT * FROM table_name"; $result = mysql_query($query); if(!$result){ die("Could not query the database: <br/>" . mysql_error()); } while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $id = $row['rowid']; $company = $row['company']; $product = $row['product']; $description = $row['description']; $web = $row['web']; $last = $row['last']; $used = $row['used']; $active = $row['active']; $myArr = array($id,$product,$company,$description,$web,$last,$used,$active); $excel->writeLine($myArr); } $excel->send('hr'); exit; } /* END SWITCH */ Here is the code I am using for my include: <?php class ExcelWriter{ var $data = null; var $filename = null; var $newRow = false; function ExcelWriter(){ } function writeLine($line_arr){ if(!is_array($line_arr)){ trigger_error("Error : Argument is not valid. Supply an valid Array.",E_USER_WARNING); return false; } $this->data .= " <tr>\n"; foreach($line_arr as $value) $this->data .= " <td class=xl24 width=64 >{$value}</td>\n"; $this->data .= " </tr>\n"; } function send($filename = null){ if($filename){ header ( "Expires: Mon, 1 Apr 1974 05:00:00 GMT" ); header ( "Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT" ); header ( "Pragma: no-cache" ); header ( "Content-type: application/x-msexcel" ); header ( "Content-Disposition: attachment; filename={$filename}.xls" ); } print $this->GetHeader(); print $this->data; print $this->GetFooter(); if($filename) exit; } function GetHeader(){ ob_start(); ?> <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=ProgId content=Excel.Sheet> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:LastAuthor>Sriram</o:LastAuthor> <o:LastSaved>2005-01-02T07:46:23Z</o:LastSaved> <o:Version>10.2625</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:DownloadComponents/> </o:OfficeDocumentSettings> </xml><![endif]--> <style> <!--table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";} @page {margin:1.0in .75in 1.0in .75in; mso-header-margin:.5in; mso-footer-margin:.5in;} tr {mso-height-source:auto;} col {mso-width-source:auto;} br {mso-data-placement:same-cell;} .style0 {mso-number-format:General; text-align:general; vertical-align:bottom; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial; mso-generic-font-family:auto; mso-font-charset:0; border:none; mso-protection:locked visible; mso-style-name:Normal; mso-style-id:0;} td {mso-style-parent:style0; padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:windowtext; font-size:10.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Arial; mso-generic-font-family:auto; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;} .xl24 {mso-style-parent:style0; white-space:normal;} --> </style> <!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>srirmam</x:Name> <x:WorksheetOptions> <x:Selected/> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> </x:ExcelWorksheet> </x:ExcelWorksheets> <x:WindowHeight>10005</x:WindowHeight> <x:WindowWidth>10005</x:WindowWidth> <x:WindowTopX>120</x:WindowTopX> <x:WindowTopY>135</x:WindowTopY> <x:ProtectStructure>False</x:ProtectStructure> <x:ProtectWindows>False</x:ProtectWindows> </x:ExcelWorkbook> </xml><![endif]--> </head> <body link=blue vlink=purple> <table x:str border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse;table-layout:fixed;'> <?php return ob_get_clean(); } function GetFooter(){ return "</table></body></html>"; } } ?> -
[SOLVED] Export Data into Excel Spreadsheet
dennismonsewicz replied to dennismonsewicz's topic in PHP Coding Help
ok... so I commented out the first thing, to just get the headers to come through and it did not work. So something is wrong somewhere, obviously everything is spelled correctly. I am running this script inside of a switch with a case name of export.