php

How to throw a server side error message in thickbox using php

Hi all, My prob in brief: I am validating a registration form with server side using php and its working fine. Now my prob is i need to show the error message using thickbox like popup. Is that possible. If yes please explain how? thanks in advance Code: <script type="text/javascript" src="thickbox/jquery-latest.js"></script> <sc...

what sha1() will do to russian or any other non english letters?

what sha1() will do to russian or any other non english letters? Will sha1() always return english letters? ...

Solr autocommit and autooptimize?

I will be uploading my website to a VPS soon. It is a classifieds website which uses Solr integrated with MySql. Solr is updated whenever a new classified is put or deleted. I need a way to make the commit() and optimize() be automated, for example once every 3 hours or so. How can I do this? (Details Please) When is it ideal to optim...

RSS feed doesnt display items. Only title

So i just made my first RSS feed, or so i tought, in combination with CI. Now my view DOES display the top of my rss page (Title and Description), But all items are omitted. When i rightclick->view source it DOES contain all the items within the item tags. Can anyone help me? View (rss.php): <?php echo '<?xml version="1.0" encoding="...

how to write the server side in php if i am using the json on client side of the iphone.

i want to make my server side in php. after writing the code in php can i directly use json to parse it of or something other required on the server side with php. can you give me some example of it, how to do this on server side if i want to use json of my client side. ...

Check Checkboxes dynamically

Hi, ive been dealing with this for some time now and need your help. well I have an array $arrayAmenities which contains a combination of the following data based on what is fetched from the database: Air Conditioned Bar Brunch Party Room Tea Room Terrace Valet I would like the application to dynamically check the following set of che...

Hyperlink for each record

I need a link for each depotname that will bring up a child window with the details of the last 10 backup status. while($data=mysql_fetch_array($res)) { if(is_null($depot_array) || !in_array($data['depotname'],$depot_array )) { $depot_array[$r]=$data['depotname']; if($data['SCP_status'] <> 'success') { echo "<tr id='fail'>"; Th...

Why Crystal php lib turns my non english latters into "?" signs? Is there a way around it?

Why Crystal php lib turns my non english latters into "?" signs? Is there a way around it? So it happens if I try to walidate something or just post into DB. =( I know - I can not to use Crystal at all but I want to! What can I do to solve such problem? ...

PHP mail () activation

I need to activate this mail() function is there any way of doing this only on my hosting account (being on shared account)? Thanks! ...

pagination in css/php

two questions: --1-- it displays all the number of pages. but i'd like it to display as: << Prev . . 3 4 [5] 6 7 . . Next >> --2-- when i hover on the current page no, it should change color or increase the font-size, but when i modify the css of a:hover, all the page nos change color or size instead of the one which i'm pointi...

PHP UTC Timestamp Creation

I am using ubuntu(apache) for my php application.i need to create a timestamp for authenticated call of a webservice.In php i getting only 10 digit timestamp like 1273229733.But i need to create like 1273229613000 .How can i solve this problem.help me please. ...

PHP/Javascript - get php variable within javascript

I have run into an interesting problem. I am currently developing php page and need to access a php variable within the javascript onload. $(document).ready(function() { var temp = <?php $page_id ?> } is this valid? I know that this might seem weird and not be allowed but I am developing a page that has two popup windows. The wi...

i want get the sum of files size in folder by php

i have an folder 'files' ok i want know the sum of size of its files ...

How to show a server side error message in a popup using php

Hi all, I found some of the similar questions here but they are all in C#. So kindly tell me the easiest way to show the server side error message using popup. The popup may be anything like thickbox, modalpopup etc... Here is the sample code. I didn't get the error message in the popup. <script type="text/javascript" src="thickbox...

How to "redefine search" or correct "misspelling" from the database

Hello i want to add new feature to the search in my website. i'm using PHP and MYSQL. mysql database containing a table to the items that the user will search for, for each item there is a "keyword" column that's comma separated keywords "EXAMPLE: cat,dog,horse". after the user search in my website i want to get the words that are let ...

Dynamically writing page titles and active classes with php

For some time now I've been using the following code to dynamically write in html page titles and add an active class to menu items. Is this still a good why to achieve this or are there better/smarter/optimal ways of achieving the same thing? <?php echo (basename($_SERVER['SCRIPT_FILENAME'])=='contact.php'? 'class="active"' : '');?> ...

return a php associative array to javascript array

I am trying to return a php associative array to javascript array through ajaxRequest.responseText Here's what I do. First in php, I do this: $encoded = json_encode($thisarray); echo $encoded; If I echo $encoded, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"} Then in js script, thisarray = new Array(); thisarray = ajax...

Sort XML nodes with PHP

I have a serialized string comming in with POST: $imgdata = $_POST['imgdata']; // li[]=2&li[]=3&li[]=1&li[]=4 In this example 001 is reordered after 003 How can I update my XML file with this new order? I think I need simpleXML or xpath. Here are my thoughts: // 1. load xml string $xml = simplexml_load_file('test.xml'); /* <?xml vers...

{textarea} smarty php

Hi, further to a previous question, I have this code: <p class="required"> {err for="msg"} <!--{{label {t _inquiry_msg}:}}--> {textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"} {/err} </p> And I want the output to be <textarea onblur="if(this.value=='')...

PHP: MVC and DRY

Hello! Question about controllers. Can controller call it`s own class methods inside an action? EDIT: Oh sorry. I meant I dont want to repeat myself. :) ...