php

Web Site code process with server side and client side code. When should the client side code be implemented?

I'm developing a web site, which would make use of PHP, Javascript (JQuery) and use AJAX to connect the two. My question is, how should the coding process go. I know that Javascript is supposed to be used as an extra kick, and should not be relied upon because it can be turned off. So, should I code the entire site in PHP, and then afte...

Why do so many MVC web frameworks favor grouping multiple controller actions in a single class?

My experience is mostly limited to PHP, yet as far as I know both Rails and ASP.NET MVC have taken the same path. The point is that nearly every web framework I've ever come across implements controller actions as methods, e.g. create, edit, show, etc. These methods reside in a single class like PostsController, but they hardly ever sha...

Comment $links order in drupal

In the comment.tpl, $links is printed to show the reply and edit link. In my theme, edit comes before reply. How do you change the order of the printed links? ...

I am developing a web application for a client, how can I stop them from licensing it?

I am creating a web application that I am developing for a client and I want to ensure that I maintain the rights to resell the application. How can I stop this client from licensing it himself? Thanks. Could something like this be used? here http://www.developer-resource.com/sample-eula.htm ...

auto hyper-link

Hello I am trying to auto generate pages. What I am trying to do is make a upload form for an image upload that's displayed in a gallery. I have this but I then want each image to have a page hyper-link auto made for each image where the image can be seen bigger with buying information that's also been uploaded to a MySQL table not 10...

Open and view and/or edit check 21 image file

Does anyone have a library or have a way in PHP or JAVA to view, edit or break down x9.37 files also known as check 21 image? ...

difference between :: and -> in calling class's function in php

I have seen function called from php classes with :: or ->. eg: $classinstance::function or $classinstance->function whats the difference? ...

php socket server disconnecting

I'm trying to set up a socket server in php that stays open. This example taken from php.net will close after it receives connection...even after I comment out socket_close($spawn) <? // set some variables $host = "192.168.1.109"; $port = 1234; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_S...

rand() faster mysql php function

Hi How do I select wallpapers randomly, but cache the last selected one for 10 seconds (for performance reasons)? the faster RAND() function use Cache in wallpapers or image i use this but i need to but cache in image timely change after 1 mins or 5 mins to chnage images in RAND() randoms wallpapers i use this : $sql_wallpaper = "S...

SQLite suitable for concurrent reading?

Will an SQLite database perform well to around 50 reads/second without locking? I'm trying to decide whether it'd be feasible for use on a PHP website that won't get 'written' to very often - it'll be mostly reads of the same data from a small handful of tables Thanks ...

Soap Response Namespace issue

Hi, I have created simple soap server using php, The WSDL used is at : http://fromyourdesign.com/webapp/wsdl/fromyourdesign.wsdl Response i m getting has a miss matched namespace for the Login response tag: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="...

uncompress zlib network packet from hex

Hi, I am reversing some kind of protocol and it looks like it is using zlib compression, the current packet is : 170300002009254CBCE1DC7A5578D1588577EF63AE8DDCA721FFCA453775BCA7375CB65EE31703000090AA883A355CB9A7450EA7BA8D485C655EB5FCB71E22F274E9FF03F326296E7F2D5960AB7CFB2986C4985D6B7D33BE2C7348142D738B522C3B89AA3723A5CADB9C3DF124B3AB4...

count total items in a multidimensional array

Hi, How can I count the total items in this array below? Array ( [upload] => Array ( [name] => Array ( [0] => 1024x768.jpg [1] => 1280x800.jpg [2] => 1280x1024.jpg [3] => 1440x900.jpg ) [t...

PHP: how would I use this simple class?

I was looking around for more "correct" login/logout portions of code, and found this one: http://snipplr.com/view/1079/auth/ I got two questions though that stop me from using it. 1: How would I instantiate the class, and use it in my script?(I know PHP but am just befuddled for some reason) 2: there's the following lines: global $db;...

Ajax PHP MYSQL on enter

I am using the below code to search a mysql database but cannot get the form to submit when the return key is pressed. Does anybody have any ideas? function ajaxFunction(){ var ajaxRequest; { // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new...

Doctrine case sensitivity in schema.yml

Doctrine turns my column names into all lower case to improve compatibility. How do I prevent this from happening? users: actAs: [Timestampable] columns: userId: type: integer length: 4 primary: true autoincrement: true or $this->hasColumn('userId', 'integer', 4, array( 'type' => 'integer', ...

Dealing with quotes in TinyMCE, PHP message board

Hi everyone, I decided that my client would be overwhelmed by a lot of bells and whistles in a message board like phpBB, so I started from scratch. So far everything has been working really well, apart from a little issue with quotes in replies. When the user clicks Quote, they see this (using tinyMCE as my WYSIWYG): This is a blockq...

PHP % operator, what result should be returned?

Hi, $djs_all_num = mysql_num_rows($djs_all_db); while($djs_all = mysql_fetch_array( $djs_all_db )) { if ($djs_all_num % "2") { With my if () statement, this should halve the amount of rows, and so in the else further on it should display the rest. Is this correct? ...

php error query was empty

You can see I can successfully redirect values from one to this page. $shipping_first_name = $_POST['shipping_first_name']; $shipping_address= $_POST['shipping_address']; $shipping_city = $_POST['shipping_city']; $shipping_state = $_POST['shipping_state']; $shipping_zip_code = $_POST['shipping_zip_code']; $shipping_phone = $_POST['shipp...

Help on displaying data in colunm PHP MySQL (Modified Preorder Tree Trasversal)

Hello I'm trying to get a multicolumn display (if it can be called so) with the code below here is the result: . Someone can see why These leaves are broken? or tell me please which is better: a catagory table linked to a subcatery one, or an adjacency model list. $stmt = $conn->prepare("SELECT node.idCat_ad ,node.".$cat_name.",(COUNT...