php

How to stripslashes all the items of an array at once?

I need to stripslashes all items of an array at once. Do you how to............ ...

why include instead of require in php cms?

I see php CMS using include instead of require for their important files. SHouldn't this files such as header.php be required? THe script continues if the file is unable to be opened! ...

In PHP, under what conditions does an unset() call reset the array index?

I've found a strange issue when using unset function in combination with a SimpleXML decoded array. The unset function applied on one of the index of such an array (which is numeric-indexed), seems to reset the array index. This seems like an undocumented behavior to me (or more like a bug). Has anyone got an explanation why there's a ...

How do I get around apache owning files uploaded to a PHP webserver?

Hey all, I am working on a PHP web app on a Linux web server for grades and documents for a course that I am co-teaching. The page I am writing at the moment is for submitting assignments, where the student selects an assignment from a drop-down menu and then uploads the assignment and submits. On submit, all the information about the s...

Can't send textfield value to PHP file with jQuery

I would like to send this textfield value to a php file using jQuery. HTML code: <div> <label for="email">Email: </label> <input type="text" id="email" name="email" /> <span id="msgbox" class="msgbox"></span> </div> jQuery code: $(document).ready(function() { $("#email").blur(function() { $("#msgbox").rem...

Does the position of the brackets really matter in PHP (for instance, for the sake of readability)?

I started with CSS so I always used brackets this way: #content { selector: value; } While using CodeIgniter I noticed that each file have the brackets like this: function something here() { $this->$item('item'); $data['rows'] = $this->data_model->getAll(); $this->load->view('home', $data); } Is the second example...

Generate/download CSV and redirect

Hi, I'm trying to figure out what the best approach would be to dealing with a form submission which involves updating db records and generating/downloading a CSV file, before redirecting to the original calling page. I've seen posts saying that javascript is one way of dealing with this, but what would you recommend as good practice? H...

Adjusting a php function so that it displays link in the form of:- '/widgets?pg=2' instead of 'products.php?cat=20&pg=2'

I added the following .htaccess rule:- RewriteRule ^widgets$ products.php?cat=20 [QSA] So now I have a simple link called 'widgets' which leads to the 'widgets' category 1st page. However, the links to the 2nd page looks like the following:- products.php?cat=20&pg=2 What I would like is for the subsequent pages to be rather in th...

php mail sends multiple copies

i'm using drupal 6 and tries to send an email to all users by using following code . The problem is sometimes the mail sends to users multiple times but sent folder holds 1 entry for each user. Specially yahoo ids got more than 2 mails(3 to 4) and sent shows 2 emails sent to each yahoo id . is anyone knows it .. <?php require("/var/www...

Web page interfacing with COM port to control page

Hello, I'm looking at creating a project that has a touch screen panel on a com port and a front facing website. I want the touch screen panel to interface with the web page, it will have two buttons (left & right) and I want those actions to "do something" on the web page. I'm trying to work out which programming/scripting language w...

jQuery: Send Array

Hi, How do I send an array from PHP to jQuery? I have many <input type = "text" id = "search_term" />. How can I send this data to jQuery? <head> <script> $(document).ready(function(){ $('#button1').click(function(){ var search_val=$("#search_term").val(); $.post("ajax.php", { search_term : sear...

Installing Aptana and Eclipse PDT - what should be main and what as a plugin

I would like to use an IDE for PHP Development using Zend framework & jQuery. I decided to use Aptana Studio. There is no PHP support in [Studio 2][2], so I have to use Eclipse PDF. My question is: Should I install Eclipse PDT first and the use Aptana as plugin or install Aptana Studio and then install Eclipse PDT as a plugin? What are ...

How do I suppress a specific error in php

Hi All, I want to suppress the timeout error in a script that is running automatically. The fact that the script is timing out is not a problem since it will be running again in a minute after the timeout. I DO want all other errors reported. Any ideas? ...

Xdebug ignores breakpoints

Hey guys, i am currently trying to get xdebug to work on our development server. As client i am using netbeans and the connection so far works without problems. But when i try to set a breakpoint within netbeans it is just getting ignored. And yeah, i already googled for hours and also found some questions here that perfectly fit my d...

Output CSS only if DIV contains content

Hi, I have two gallery buttons, a next and previous, each of which is wrapped in a DIV tag, and want to apply a background image to each. However in some galleries at times the next button may not be output if we've reached the end of the available gallery images. Currently my background image would still appear, even though there is n...

MySQL Multiple Tables Link

Hi there I'm new to these types of MySQL Queries. Basically, I have two tables in a MySQL Database. One is called groupmembers and the other is called users groupmembers contains rows with two columns, a groupid and a userid users contains rows with also two columns, a userid and a username I am trying to write a query that searches t...

how to add ellipsis to pagination?

Hello! I need help adding an ellipsis to my pagination script. I can't find anything simple on Google. So that's why I ask on here. Thank you!!! Here is the code; if (isset($_GET['p'])) { $pageno = $_GET['p']; } else { $pageno = 1; } // if $query = mysql_query("SELECT count(id) FROM m3_musicblog"); $query_data = mysql_fetch_row($q...

PHP AES encrypt / decrypt

Hi, I found an example for en/decoding strings in PHP. At first it looks very good but it wont work :-( Does anyone know the Problem with it? <?php $Pass = "Passwort"; $Clear = "Klartext"; $crypted = fnEncrypt($Clear, $Pass); echo "Encrypred: ".$crypted."</br>"; $newClear = fnDecrypt($crypted, $Pass); echo "Decrypred: ".$newClear...

Zend OAuth with twitter single access tokens

Hey all, I'm developing an application where it requires users to sign in using twitter and OAuth. Everything works just fine thanks to Zend_OAuth. The problem is that the web app will also make some calls to the twitter API but these will be handled internally without the need of authenticating. Twitter Dev provides an 'access_token' a...

Auto-Commenting Tool

Hello All, I recently created a CMS for the client which is meant to work out of the box. But I made a mistake by not commenting my code at the time of writing. Just wanted to know if there is a tool that will go through the files of CMS and add comment blocks automatically. Let's suppose I have this code: class foo{ function bar(ar...