Hello, Recently I am using phpexcel and afer many tries I wasn't able to find out how to make a document with a image in its header. Here is a simplified code that I am using. Can someone helps me with this issue?! <?php require_once 'PHPExcel.php'; $objPHPExcel = new PHPExcel(); $objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing(); $objDrawing->setPath('header.jpg'); $objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_RIGHT); $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader("&C&G"); $objPHPExcel->setActiveSheetIndex(0)->setCellValueExplicit('A1', 'CODICE PRATICA'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); $objWriter->save('test.xlsx'); ?>

Member Avatar
Member Avatar
+0 forum 4

Hello, After searching over the internet how to secure a web application(forms) in PHP, in most of the cases were just suggestions not a short and real example. In some cases is suggested to use strip_tags( trim( $_POST['PARAMETER'] ) ); but when you have some special inputs like comments field htmlentities ( trim ( $_POST[ ‘comment’ ] ) , ENT_NOQUOTES ); is suggest. Maybe there is a useful example (custom made function) to achieve standard safe methods without introducing complicated libraries like HTMLPurifier into the application. Thank you for your time!

Member Avatar
Member Avatar
+0 forum 5

Hello, In my project I have a form with many inputs and one object is using DropzoneJS to attach files. Since I store all the inputs when I post the form I need somehow to read the file names of the uploaded files in my server, currently I can only get the list of the original filename of the files that are uploaded. For many reasons when a file is uploaded I am giving it a random name with time() function. A part of my HTML form <form id="appointment-form" class="box-body no-padding"> <input name="firstname" type="text" /> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 …

Member Avatar
Member Avatar
+1 forum 4

Hello, I am trying to manipulate a HTML content stored in a php variable. The logic is as follows: The variable should be checked if it contains an <img ... /> tag and if a tag is found it should be wraped in an <a> tag and some parametres of the a tag should be read from the img tag. The code in the end enables the fancybox plugin to all images, this can be done even via JS, but in my case I would like to have the content ready as it would be served to the visitor. Example: …

Member Avatar
Member Avatar
+0 forum 4

Hello, Recently I am starting to code my scripts in PDO method to manage the information in a mysql database. In this case I am having an issue how to use the best practice conditions when dealing with a POST **int** value. With the posted values I am making a select query, a short version of it is as follows if( isset($_POST['gjendja_id']) ){ $gjendja_id = intval($_POST['gjendja_id']); if( $gjendja_id > 0 ){ $gjendja_id = $_POST['gjendja_id']; }else{ $gjendja_id = 'IS NOT NULL'; } }else{ $gjendja_id = 'IS NOT NULL'; } The query that would be executed try { $counter = 1; $response …

Member Avatar
Member Avatar
+0 forum 7

Hello, Recently I am dealing with bad performance in an php application that I have build, googling this issue I found out that using services like memcached you can archive a huge performance improvements. The weird thing comes when I try to find a very good and detailed example I failed to find something. Could someone helps me giving a good url or example using php + mysql + memcached?! Thank you!

Member Avatar
Member Avatar
+0 forum 3

Hello to everyone, Currenty I have a php project that uploads files to the server and save some extra information into the database. My problem is that I want to make a feature that copies a folder structure with files included to a database. I am trying to copy the folder structure, but the issue is that I cant follow the relationships with the new ids. The main structure of the table is like this CREATE TABLE `people_folders` ( `id` int(11) NOT NULL AUTO_INCREMENT, `folder_id` int(11) NOT NULL COMMENT 'Here is stored the root folder id', `name` varchar(255) NOT NULL, …

Member Avatar
Member Avatar
+0 forum 17

Hello to everyone, Currently I am building a web application in php. The users have option to upload/download files into the server folders, but the issue is that they should also edit at least some types of documents(Word & Excel) that are uploaded online via the browser. I have seen the Google offers Google Docs and also Microsoft has its own online document editor, but they use their storange to save files. I want some kind of php script that gives you the ability to edit this documents and after that saves them to my own host. Could someone suggest …

Member Avatar
Member Avatar
+0 forum 1

Hello, Currently I am using my computer as a webserver, as I own an IP I have made the config to access it from outside. So now I can access my php sripts via http://MY_PUBLIC_IP:PORT/site.php The weird thing is that I cant get the visitors IP This script is working very good on sites with no ip on the url. Could someone help me with this issue?! function getUserIP(){ $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; if(filter_var($client, FILTER_VALIDATE_IP)){ $ip = $client; }elseif(filter_var($forward, FILTER_VALIDATE_IP)){ $ip = $forward; }else{ $ip = $remote; } return $ip; }

Member Avatar
Member Avatar
+0 forum 1

I am trying to get a variable from a javascript function, but I am having a problem getting it the variable value outside the function. The variable value can be outputted just fine inside the function. Here is the script, but how can I get the value of status and use it outside the funcion? Maybe I am doing it in the wrong way, but in the end I want the value of variable to be the value of status. <script> function get_id(){ $('.addressClick').click(function() { var status = $(this).attr('id'); alert(status); // Here the value is printed correctly return status; }); …

Member Avatar
Member Avatar
+0 forum 10

Hello to everyone, I am trying to create a .php file that delete database rows with a popup window that confirmates the action. I know that are a dozen of examples, but after meany tries do to that I was not able do that, because I haven't knowledge about javacript. Also posted something before [here on daniweb](http://www.daniweb.com/web-development/php/threads/477645/how-to-get-id-in-bootstrap-popup), but with no response. After some researches I found this([link](http://myclabs.github.io/jquery.confirm/)) example source code [github link](https://github.com/myclabs/jquery.confirm). Here is a simplified code that I have managed to "create", but I only get the popup windows when I click on delete action of Item I. Could …

Member Avatar
Member Avatar
+0 forum 4

Hello to everyone, I am trying to get a some values from the database. My issue is that I want some results stored into a variable to be exactly 25 caracteres long. When the result($title) is > 25 caracters long there is no problem with this substr($title, 0, 24), but when the result($title) is less than 25 caracters long I want that difference to be filled with spaces. Also another issue is that I echo this result($title) so the spaces I think that should be &nbsp;

Member Avatar
Member Avatar
+0 forum 5

Hello to everyone. I have this table: CREATE TABLE `documents_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL, `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `active` varchar(255) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; I am trying to create a qyery that gives me: `(subcategory id, subcategory title, category title)` The categories has the `parent_id = 0`

Member Avatar
Member Avatar
+0 forum 2

Hello to everyone, Currently I am working with bootstrap. I generate a list with users. My issue is that when I click on delete a popup confirmation is shown but I don't know how to get the id of the user that I am trying to delete. I have seen a lot of example on web but haven't found the solution. Here I am also including an copy of the script and database.

Member Avatar
Member Avatar
+0 forum 3

Hello to everyone, I have a mysql table CREATE TABLE `tools_domuments` ( `id` int(11) NOT NULL AUTO_INCREMENT, `filename` varchar(255) CHARACTER SET utf8 NOT NULL, `description` longtext CHARACTER SET utf8 NOT NULL, `filetype` varchar(255) CHARACTER SET utf8 NOT NULL, `document` longtext CHARACTER SET utf8 NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; In the column 'document' I am inserting the content of the files encoded with Base64Encode. I am doing this with an desktop app. My issue is that I want a php file that when I execute it, to download a file that is stored in a specified …

Member Avatar
Member Avatar
+0 forum 2

Hi to everyone, I am a begginer on php so maybe this question will appear to simple to someone. My issue is that I want to output a list with all .zip files that are in my site directory. Also for each file I want some details for exemple: Filename: Simple.zip Size: 3.2Mb Created Date: 11/11/2013 File Path: .... Could someone help me with my problem?! Please consider that I am a beginner and some php functions that you may suggest to me may not be very usefully in my case :(

Member Avatar
Member Avatar
+0 forum 2

Hello, Recently I am trying to make a php file than when it is opened it should backup a database and promt the user to save the .sql file... This is a feaure that has phpmyadmin but I want something very simple, just clicking http://mywebsite.com/backup.php and the file should be avaible to download. Could somenone help me?!

Member Avatar
Member Avatar
+0 forum 3

Hello, I am trying to make a .html document that has an image inside it. I have seen this before, but I don't know how to do it. The idea is here I don't want a index.html and image.png files, but I want just a index.html that containd the content of image.png inside it. Could someone help me?!

Member Avatar
Member Avatar
+0 forum 5

Hello, I have two tables one for the company staff and one for their projects(table name objecte). The table objekte has 4 colums that are connected with the id of the staff. The problem is that I want a query that shows all staff's names. I have also included the sql of the tables in this post and a preview of what I am going to do. Can someone help me?

Member Avatar
Member Avatar
+0 forum 4

Hello to everyone. I have a Joomla! site in Albanian language, I decided to put google ads there but where I tried Google replied that my site language was not supported by them. Now if I create an English version of my site can I add google ads in the Englisht part of it?! All ads will be in the http://mysite.com/en part of the site. If anyone have some suggestion please tell me, thnx for you time.

Member Avatar
Member Avatar
+0 forum 2

Hi, I have some time that I am trying to build a page with some menus and to include joberbase into one menu but I am having a problem to include it on the page. I am using iframes to show it, but when I click on Post New Job the height of the joberbase page change and gives an extra scrollbar. I think that this problem might me solved with some javascript code. Can someone help me?! Here it's the link to donwload a sample of the project http://www25.zippyshare.com/v/14082818/file.html

Member Avatar
Member Avatar
+0 forum 1

Hello to everyone, I want to direct foreign visitors of my site in one directory, this based on their IP. My site structure is: index.php(file) |->foreign(directory) I think that this can be done with .htaccess, but I don't know how Can someone gives me an example how to do this?

Member Avatar
Member Avatar
+0 forum 1

Hello to everyone I am a begginer in VB6. My project consist just on a form and a web object, the problem is that I want to dissable the sound that make the application when I click on links. Can someone help me?! Plese write the code here because I am not familiar with VBS syntax!

Member Avatar
Member Avatar
+0 forum 4

The End.