php

php script to write files and create zip file

Hi I'm trying to develop an online formbuilder. Each user can build their own forms and I want to be able to provide a button that when clicked will download the users html form page along with its css file as a zip file. I know how to zip the files, but my problem is that the main users html form page doesnt exist as seperate file, it...

Using Highrise API Wrapper

Good Day. I am trying my hardest to get my mind around PHP for building an site where you can see Highrise events printed out. Found this wrapper, but do not know how to use it, what i should write to get use of this wrapper. Please Help. http://101tec.com/en/open-source/highrise-api-wrapper is the link for the wrapper. ...

How do I convert a date of the format DDMMMYYYY into a db storable date

Hi guys my application parses text files where date values are stored in the format: DDMMMYYYY eg: 12MAR2009. I noticed that inserting this value as it is into a database datetime value doesn't work at all. How do I convert this into a datetime value which can be entered into a database. My application is in php. ...

Overriding user edit profile form

Im using theme_user_profile_form($form) and putting in the line unset ($form['timezone']); But it doesnt remove that item from the page I try: theme_preprocess_user_profile_form but it doesnt appear to work. All I want to do is remove some portions of the user profile edit form, such as theme select, timezone etc ...

How to submit a form with AJAX/JSON ?

Currently my AJAX is working like this: index.php <a href='one.php' class='ajax'>One</a> <div id="workspace">workspace</div> one.php $arr = array ( "workspace" => "One" ); echo json_encode( $arr ); ajax.js jQuery(document).ready(function(){ jQuery('.ajax').live('click', function(event) { event.preventDefault(); ...

Form validation with PHP and Javascript security

I was wondering if it is really necessary to validate in both JS and PHP? I have my submit button with JS document.myform.submit()sending with PHP POST to the same page.  If a user disables JS he can not send the form anyway. So I wanted to ask about security, can someone send the variables in another way bypassing the javascript? How wo...

Subrequest for PHP-CGI

virtual() can be used only when running PHP as an apache module. My shared hosting runs it as CGI so it doesn't work. Is there any other method to do it? Note: the subrequest is for static files that I'd like to let Apache serve (for performance, HTTP-headers caching, etc.). Right now this is handled by using an HTTP redirect (that I wa...

Which ORM for codeigniter?

The quote below has convinced to finally go ORM. In the past I havn't really liked ORM and wrote it off as a stupid way of doing sql. Dealing with hierarchical data in sql is a pain I don't want to deal with. There's a reason we have these “Object-Relational Mapper” things, and it's because of a problem known as the Object-Relational...

Game mechanics/point system open source

Hi: I am interested in examples using php and mysql of point systems. For example, for a given action on the website, users would receive varying amounts of points that could be redeemed for things. Thanks, Cire ...

Is it possible to fetch values using smarty, php, JQuery from another page ? [ No Cross-domains ]

Hello, I am working on smarty template files. core php of that template engine are encoded with ioncube. So I am restricted to get certain values on certain pages only. For Example, I get value of {$clientemail} only on clientareadetails.php on clientprofile.php value of {$clientemail} is null So, Is it possible to fetch values...

PHP - Converting a string into various date formats

Hi I am new to PHP and cannot figure out the best method to convert two strings I have from URL params. I would like to convert: "August 2010" to ---> "2010-08-%" and also: "2010" to ---> "2010-%-%" Thank you in advance! ...

[JQUERY] fancybox onStart onComplete status not working

hi,i'm trying to keep working onstart and onComplete method on fancybox (jquery plugin) they doesn't works for me ...do yo know why? this is the code: $(document).ready(function(){ //top-menu highlight link $(".photos").removeClass().addClass("active"); $("a.fancybox").fancybox({ 'overlayShow' : true, 'opacity' ...

CI cart session works properly with FF,Chrome,Safari but fails in IE

Building pizza delivery site. Currently using: Language: PHP Framework: codeigniter class: Cart Class Autoloaded: session Products can be easily added into the cart in FF,safari,chrome. but does not seem to be working in Internet Explorer. Tried all solutions posted on the codeigniter forums but nothing works. ...

PHP - character encoding

Is it possible to convert Aoibhín back to Aoibhín ? If it is how can it be done? Thanks in advance! ...

PHP Regex on URL - split into variables

Hi all, I am trying to implement a php script which will run on every call to my site, look for a certain pattern of URL, then explode the URL and perform a redirect. Basically I want to run this on a new CMS to catch all incoming links from the old CMS, and redirect, based on mapping, say an article id stripped form the URL to the sam...

Dynamic subdomain with .htaccess and php

I have a page like index.php?username=thurein i need to get with subdomain like thurein.mydomain.com how could i get it? ...

make directory inside htnl folder in apache server

Hi, i am trying to use mkdir command. i am trying to create a folder under /var/www/html/some-appication . i get permission error. i need to create a folder in some-application folder . what steps do i need to take before doing it. here is the command i am using $structure = '/var/www/html/'.$patientId; ...

Calling Perl script from PHP and passing in variables, while also using variablized perl script name

I normally call perl scripts from PHP as below and pass in variables this way, and it works fine, however now I am building a component for re-use where I want to also variablize the perl script name that I am passing in and this is giving me some headaches, so I am wondering if anyone can point out a better way to do this as my way isn'...

capture imagemagick command output in php

Hi all, I'm running the below imagemgaick command which outputs to stdout: compare <img1> <img2> -metric MAE null: I'm trying to capture the output of this command from PHP. Normally I use the exec($cmd,$output) commands which stops cmd output from going to stdout and instead places into the $output array. However for some reason her...

PHP/APACHE: can i auto_prepend to a .js file?

I'd like to auto_prepend_file all my js files with: var SITE_ROOT = 'http://www.mydomain.com'; Can this be done in .htaccess like it can for php files, if so, how?!!! ...