php

What's the relationship between user_access and hook_perm in drupal?

It seems both of these functions are used to check whether a user has some previledge. And the difference isn't obvious to me. Can someone elaborate? ...

PHP syntax for postgresql Mixed-case table names

I have a code below: <?php require "institution.php" /* in this portion, query for database connection is executed, and */ $institution= $_POST['institutionname']; $sCampID = 'SELECT ins_id FROM institution where ins_name= '$institution' '; $qcampID = pg_query($sCampID) or die("Error in query: $query." . pg_last_error($connection));...

Can I use Delphi to write to BDE an PHP to read from it?

I strongly prefer not to use additional 3rd party components, libraries or DLLs (at least in v1.0), unless there is absolutely no other solution. Question: (how) can I use Delphi to progrtiamatically crate a BDE database and write to it, then use PHP to read from it? Any URLs for examples of tutorial? People are advising against it...

How to get response as json format(application/json) in yii?

How to get response as json format(application/json) in yii? ...

How to detect where the $end error in php is exactly is

I'm having trouble with this error in php: Parse error: syntax error, unexpected $end in J:\Server\xampplite\htdocs\exp\printact.php on line 172 It might be a lack of bracket or something. Is there any tool that could help me pin point where exactly the error is? EDIT: Here's the code, its a mess:) <link rel="stylesheet" href="pri...

Auto update after specific day passed

Hey guys, i've this theme of the week script, easy, just post like normally, save in database and echo it in a column. But since its theme of the week, i would like it to automatically renew the value to say "none" or "not set" after a week. I know cron jobs could do this but is there another way? [Running in PHP] ...

Sending jQuery.ajax data simultaneous to a form submit

I have a bit of a conundrum. I have a form which has numerous fields. There is one field for links where you enter a link, click an add button, and the link(using jQuery) gets added to a link_array. I want this array to be sent via the jQuery.ajax method when the form is submitted. If I send the link_array using $.ajax like this: ...

Wordpress form handling

I need to add a basic form page in the website, that runs on WordPress framework. I have the following raw materials ready: Client side: html form layout,css and jquery validation code. Server side: form handler php function that processes the $_POST[] data. My problem is to integrate this code in the Wordpress framework. I have look...

migrate a portion of a mysql table to SQLite

I have a mysql table set up like so: user_id | document 44 [blob] 44 [blob] 44 [blob] 46 [blob] I'd like to export all of user_id 44's data to an SQLite3 file. Best way to go about this without writing a script that reads the data and dumps it into a SQLite file? ...

PHP How do I properly check if an array is multi-dimensional - strange array behavior

If I have this array: $foo[0] = 'bar'; $foo[1] = 'bar bar'; echo $foo[0][1]; // result a // i.e the second letter of 'bar' I want to check that $foo[0][1] is not set i.e if I had: $foo[0][1] = 'bar'; it would evaluate to true, but in my original example of $foo[0] = 'bar' I would expect that: isset($foo[0][1]) would return fa...

How to print element values when iterating through XML document in PHP

I am iterating through the results of a service call to yahoo news thus: //Send service request if (!$yahooResults = file_get_contents($yahooRequest)) { echo 'Error processing service request'; } //Read result into xml document $yahooResultXml = new DOMDocument('1.0', 'UTF-8'); $yahooResultXml->loadXML($y...

Getting model name from model instance YII

How can i get model name from model instance. For e.x. $model=new State; here, State is model $model is State model instance. I want to get model name i.e State from $model i.e model instance. ...

select similar values from mysql database

Hi I have several data s in MySQL database. In my table there is a column called rank. what I want is when some one enter a rank say 25 then the result should display names on similar(+ or -) ranks LIMIT to 10 from table. example mathew - 25 john - 26 joe - 25 stewart - 27 kelly - 24 brandon -23 magy - 22 .......etc. Thanks Mathew ...

Should the PHP files that do processing/validation of data called by AJAX be put in 'include' folder and made inaccessible to the user?

My Question is suppose I have a form which needs validation through AJAX. The AJAX is sending data to to a file called do_ajax_validation.php. Now should I put this file in 'include' folder and name it do_ajax_validation.inc.php and bar it from direct access of the user or should I put it in the directory in which the original form resid...

reCaptcha integration with php

Hi there, I'm building a contact us page that also uses a reCaptcha, but im having a few issues with it. I fill in all of the fields in the contact form and the correct reCaptcha words, but the form does not submit. I'm assuming this is something to do with the validation, but wondered if someone might be able to spot where i'm going wr...

What should a PHP/MySQL web developer know about servers?

I develop websites using PHP and MySQL. What resources would a seasoned web developer recommend that would cover server-specific information relevant to the job of a developer. If it helps, I work specifically with an Apache server (through my hosting company). ...

imagick setFontStyle() error

Hi, i'm currently trying to create an image with some text, the whole text and some options being dynamic. I've got it working to the point that the font used and the font size is dependent on input from the users, but when i tried changing the font style... well.. that's when it all got downhill.The code that generates the image is this...

is it right way( safe) to assign post data value directly by name attibute value to a variable in php

i m working in PHP since one year, but now a days i got this way to assign post data value directly using name attribute . i m really curious to know the documentation about it.please refere me link regarding this . i explain by example here is my form <form method="post" action=""> <input type="text" name="userName" id="userName"> <i...

PHP 5.1.6 ArrayAccess error when iterating over object

Hi, I'm having to develop a site on PHP 5.1.6 and I've just come across a bug in my site which isn't happening on 5.2+. When using foreach() to iterate over an object, I get the following error: "Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference..." Does anyone know how to get around thi...

returning null array...

<?php <?php $movies = $facebook->api('/xxxx/movies?access_token='.$session['access_token']); ?> when i try to get other's user information its returning null array....while when i try this get my information it returnin right.. what am i doing wrong.? ...