php

PHP: How to call function of a child class from parent class

Hi, How do i call a function of a child class from parent class? Consider this: class whale { function __construct() { // some code here } function myfunc() { // how do i call the "test" function of fish class here?? } } class fish extends whale { function __construct() { parent::construct(); } function...

Pairing elements of an multidimensional array

I'm having two arrays in PHP as follows: Array1 ( [1] => Array ( [0] => 16 ) [2] => Array ( [0] => 17 [1] => 29 ) [3] => Array ( [0] => 30 [1] => 31 ) ) Total Element Count: 5 Array2 ( [1] => Array ( [0] => 21 ) [2] => Array ( [0] => 22 ) [3] => Array ( [0] => 23 ) [4] =>...

How to send email without my own mail server by PHP?

Is it possible to use Google's mail server for testing purpose,and replace the address of mail server when my own server is ready? ...

Javascript validation is bad?

Hi, It has been long time since we have been validating our forms using javascript. I am sure this must be the case with most other developers. Question: What if the user (or probably a bad guy) disables javascript? You are lost !! Is javascript validation worth of it? Should we ever use it now? Are there any solutions to this? Cor...

Is there no scope for a Windows application now?

My boss has asked me to write a CMS for a web-application. A place from where the user can customize all the necessary details, upload images etc. I know PHP but not JQuery. So things became difficult for me. I am proficient in .NET Windows applications, but my boss says it;s an end to Windows-based apps. He is right I know, but I want...

PHP - Automatically call one one before another?

Hi, In PHP, is there any way to make class method automatically call some other specified method before the current one? (I'm basically looking to simulate before_filter from Ruby on Rails. For example, calling function b directly but getting the output 'hello you'. function a() { echo 'hello'; } function b() { echo 'you'; } Any a...

Match literal string

I have this web page where users can add smilies to their comments. And I want to limit the number of smilies per comment. The "system" works but I have some problems with the regex part. I have my smilies defined in a config file like so: $config['Smilies'] = Array ( // irrelevant stuff 'smilies' => Array ( ':)' => 'smile....

Commercial PHP Job Board Script

I found some but still want to know more about them. Any of you using a very good (commercial will do) PHP Job Board Script. ...

How to make silde like homepage of adidas.com with jquery

adidas.com so cool !!!!!!!!!! why not with jQuery, CSS & HTML? How div with different height & width together fill up div container when height & width are get random from database? Someones help me? ...

Can we use PHP classes in Asp.net

I have got some library files in PHP. i want to use them in asp.net. please give me some idea that how to use it or how to convert it to be used in asp.net (vb.net). actually i want to connect with a xml based web service (HostelsClub) but they just have API in PHP not in asp.net. so what to do. ...

will file_exist() php function cause high server load ?

i am trying to check if user uploaded his or her avatar image and i use file_exist() php function to check if the user avatar image exist or not will this cause any server load problem with massive traffic websites ? thanks ...

Seting User Agent param in PHP Simple HTML DOM Parser

Is there any way to include the user agent string along with the request send by PHP Simple HTML DOM Parser? ...

PHP iMagick image compression

Hi All, I'm fairly new to iMagick and have only found very limited documentation on the PHP library. I'm happily resizing images and writing them back to the hard drive, but I'm failing completely to compress the images using JPG for instance. This is the code I'm using so far function scale_image($size = 200,$extension) { if(!file_...

Get values of called file

I am calling a .php file in this code. In the file "fetchvalues.php", I am fetching results from the database and want to return the column values back to the calling JQuery function and display them on HTML controls of my page. How to do so? $(document).ready(function() { $("#Edit").click(function() { $.get('fetchvalues.ph...

dynamic sub domains

I want to show user's mini-website on the server by creating dynamic subdomains. The re-write rule is written as below: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.yourwebsite.com RewriteCond %{HTTP_HOST} ([^.]+)\.yourwebsite.com RewriteRule ^(.*)$ /path_to_your_site/public_html/app/test/home.php?url=%1 In the home.php page the ...

How can I see the SQL statements which go to the database when using PDO?

How can I see the SQL statements which go to the database when using PDO? ...

Is there a way to verify the integrity of javascript files at the client?

I'm working on what aims to be a secure method of user registration and authentication using php and javascript but not ssl/tls. I realise this may well be considered an impossible task that's been tried 1000 times before but I'm going to give it a go anyway. Every example I see online that claims to do it seems to have some huge fatal ...

PHP include from URL that redirects

I've inherited a bad sitation where at our network we have many (read: many) hosted sites doing this: include "http://www.example.com/news.php"; Yes, I know that this is bad, insecure, etc, and that it should be echo file_get_contents(...); or something like that (the output of "news.php" is just HTML), but unfortunately this is what t...

How to setup cron job?

Hi, I have a windows shared hosting account with Godaddy.com with PHP5 that does not allow cron or scheduled job. I am developing a website in PHP5 with CakePHP and I need to run a cron job to send emails. What will be the best way to do it? Thanks for your answers in advance. :) ...

how do I encrypt and then decrypt the text of username and password used in database class file

Hello everybody, I have created a class file database.php which handles all the sql queries and connecting to database. I store username and password for the database in a variable (which is easily seen if one gains access to the php file). I want to encrypt that username and password so that even after having that php file one is not ...