php

What are the tiers of N-tier structure and their functions for WEB Development in PHP?

Can anyone can tell me the N-tier Structure and their tiers used in Web Programming? Primarily, in 3 tier structure one is presentation layer, another is business logic layer and last is database access layer. But for N-tier or 4 tier structure what are the layers and what sort of functions do they hold on them? Please explain me with...

How to create a cron job in PHP for getting the update of modified date and time of files/folders?

How to create a cron job in PHP for getting the update of modified date and time of files/folders? I am a newbie to create a cron job how to get started? ...

truly unique random number generate by php?

I'm have build an up php script to host large number of images upload by user, what is the best way to generate random numbers to image filenames so that in future there would be no filename conflict? Be it like Imageshack. Thanks. ...

mysql_real_escape_string is storing the data in the database along with backslashes

When i am using mysql_real_escape_string on my unescaped strings the data in the database is storing with the backslashes which should not happen. I have magic_quotes_gpc OFF not sure why this is happening. Any idea ? Is there any setting in the mysql database which needs to be modified. I am not using addslashes any where in the code...

Open Source Web PDF Viewer?

Hey Guys, Is their any Open Source Web PDF Viewer? Which has good api through which I can modify the looks of the viewer? I had tried the Scribd, Google Docs, FlexPaper , and this also. But it is not giving me, as I want. Then i had downloaded the shadowbox but it has not given me information about how to use it? So anyone know good w...

php: trim br tags from the beginning of a string?

I know that: preg_replace('<br\s*\/?>', '', $string); will remove all br tags from $string... How can we remove all <br><br/><br /> tags only if they are in the very beginning of $string? ($string in my case is html code with various tags...) ...

An internal error occurred during runtime. Smarty

WARNING [2] include(somepath/templates_c/%%B0^B01^B019F522%%login.htm.php) [function.include]: failed to open stream: No such file or directory on Line No 1871 in somepath/Smarty.class.php Error!: An internal error occurred during runtime. Any body please tell me why this error is occuring.. ...

ImageMagick bash script issue

// This works convert ${path}${dst} -crop ${crop} ${path}${dst} // but when changed to this, it fails convert ${path}${src} -trim ${path}${dst} convert ${path}${dst} -crop ${crop} ${path}"pdf_"${dst} What am I doing wrong? ...

pass value from page to another in PHP

I am sending login status = fail, back to my login page.Here is my code- header("location:index.php?login=fail"); but that is sending through URL like- http://localhost/303/index.php?login=fail is there any way to pass value without showing in URL? And how to get this value on the second page? ...

PHP framework for old application

Hi experts, we have an old large application that was not built on any framework. However now we want to transfer it to a php framework. Its a new area for us so we are not sure what it takes to transfer the older application to a framework like Zend? Any help will be appreciated. thanks ...

Is there a recommended approach to handle saving data in response to within-site navigation without onunload event?

Hello all, Preamble to scope my question: I have a web app (or site, this is an internal LAN site) that uses jQuery and AJAX extensively to dynamically load the content section of the UI in the browser. A user navigates the app using a navigation menu. Clicking an item in the navigation menu makes an AJAX call to php, and php then retu...

What is the best software design to use in this scenario

I need to generate HTML snippets using jQuery. The creation of those snippets depends on some data. The data is stored server-side, in session (where PHP is used). At the moment I achieved this - retrieving the data from the server via AJAX in form of JSON - and building the snippets via specific javascript functions that read those dat...

PHP: How do I convert a server timestamp to the user's timezone?

Hi, I'm currently storing times using the 'time()' function in the database. However, it's using the timezone of the server, and I'd like for each user to see the time according to their timezone (set in their profile). How do I do the timestamp conversion? (and I mean from timestamp to timestamp, not to readable time) Your help is ap...

Set first party cookie in PHP

How can we set a first party and third party cookie in php ...

How to encrypt HTML source code output using PHP

I want to deter novice users from seeing the source code. I have a php code that generates a html page. edit1: I came across a simple tool which encrypted html code into %C%D%F but which worked with the browser just fine. ...

urlencode except /

Is there a way to urlencode except directory seperators / in the path ? like urlencode('/this/is/my/file right here.jpg'); ...

array intersect for object array php

hi i want to know how to array_intersect for object array. thanks and advance ...

Kohana standard_text validator not working properly on different server

$text = 'standard'; if(valid::standard_text($text) == true){ echo "Valid standard text"; }else{ echo "Invalid standard text"; } It is pretty strange the above should return "Valid standard text", though it is returning the opposite - though on the clients server it works fine. I am kinda leaning towards ...

How do I create a simple, custom WebDav application?

Hi all, To provide some context, I'm interested in the creation of an app which allows editing of HTML interfaces, simplifying things down a bit though I want to investigate WebDav as an option for controlling the collaborative data aspect of this app. I want several collab features to be a part of what I'm building. I'm running WAMPP ...

Data from array to sql

I'm making a webshop for a school asignment and therfore i needed to make a shopping cart. In the shopping cart the data is storred in an array. The code for when I echo it out is <tr> <td><?php echo $row['Navn'];?></td> <td><input type="text" name="antall-<?php echo $row['id_produkt'];?>" size="5" value=" <?php echo $_SESSION['han...