fgetcsv start an error when calling from CLI

Can run my php file fine when checking it via browser, but throws an infinite loop error when run via CLI: fgetcsv() expects parameter 1 to be resource, boolean given on line 30 (while line) Code: readCSV("feeds/data.csv"); function readCSV($csv

How to get the url parameter in js angular

Here's my url localhost/project/#/showprofile/18 I want to display the parameter 18 in my view In the app.js i have .when('/showprofile/:UserID', { title: 'Show User Profile', templateUrl: 'views/layout/showprofile.php', controller: 'authCtrl', }) He

Select with an internal join

i need select some data from two tables , please help me use inner join for this selection . players in selction2 must not be in selection1... first select : $rs = "SELECT * FROM `player` WHERE `status`=1 AND `credit`>=1 AND `username` NOT LIKE '$

How to display information if a label value is X

I would like to know how can I display na INFO from XML if the value of a tag is CANFONTI. So, I have na updated XML page: http://www.cidadehoje.pt/musics/musics/te.xml Snippet: <onairplaylist radio="RADIO CIDADE HOJE"> <element> <

Choose a file without a file name using url rewrite

How can i pick the file in a folder without giving file name using htaccess, like, www.domainname/folder/ while the actual link is www.domainname/folder/filename.pdf (NOTE) I have only one pdf file in the folder.You do not need htaccess for this. Onl

How to parse the string in the array

I have a string like this: "birs_appointment_price=&birs_appointment_duration=&birs_appointment_alternative_staff=&birs_shortcode_page_url=http%3A%2F%2Flocalhost%2Fstreamline-new%2Fworkshop%2F&_wpnonce=855cbbdefa&_wp_http_referer=

How to delete everything between a key phrase and an end tag?

I am trying to strip everything between a key phrase and ending tag but for some reason it is not working. I always get blank data. I've tried many different ways but no luck. Basically I have a script that connect to IMAP and store emails into MySQL

Why is uninitialized property made public in the classroom?

Consider below code please: class foo { function bar() { $this->baz = 'hello there!'; } } $f = new foo; $f->bar(); echo $f->baz; // hello there! Why does above code work ? I mean I have not initialized the $baz variable and also I am not using __

php send an e-mail with attachment PDF

I am creating pdf using FPDF . Pdf is generating perfectly and also pdf is available with email. But i want to send body message also. I have tried with body message. Example Fine text message This is text message from shohag But only pdf attachment

How to display images and load more if needed?

I'm trying to make a script for PHP that loads 5 lines of images where 3 images on all lines are loaded and showed, however on the last one only 2 images are loaded and a image with "load more" appears. When You push it it loads the rest of imag

Validation of the form - Minimum value of the number

Could someone offer me some advice as to form validation that restricts entry of a number below 5. I have got a donation form, simply an amount input field and a submit button to paypal. What form validation shall I use to restrict submission of the

Log off while deleting the account

Many websites I've created have user data stored in sessions for quick access. The problem is that if an Administrator chooses to delete or disable a user's account, as long as they have their session cookies they're still technically "logged in.&quo

drop-down list only with a specific file with php

I'm currently making a droplist but in the droplist let's say I only want to include only .txt extension files so any other extensions like .php .jpg or any other extensions will not be in in the droplist. How can I do that as simple as possible? Ano

Create objects on the fly without variable assignment with PHP

I'm just curious as to if creating an object on the fly is possible in PHP. I thought I'd seen it done before. Of course I can just assign it to a variable but just wondering if this possible. new className()->someMethod(); Of course this throws a sy

Help with PHP regex

I'm trying to replace all the letters and spaces after the first two, using PHP's preg_replace. Here is my failed attempt at doing so: echo preg_replace('/^[a-zA-Z]{2}([a-zA-Z ])*.*$/i','','FALL 2012'); //expected output is "FA2012", but it outp

PHP: variable (array) function?

I dont understand the function of these characters -> in this code: $var->getImageInfo(); the function "getImageInfo()" populates the variable "$var". I can use the print_r function to display all values but how do I get a specif

PHP / HTML: 500 internal server error & hellip;

The code provided in the link has problems. When trying to go to the real webpage, it gives me a 500 internal server error. What is wrong with the code? Anybody knows? http://www.gdscei.com/myphp.txt I am using iWebKit. (I know you cannot read the te

php: how to add an odd / even loop to a table

here is my code: http://www.pcgage.net/code.zip (sorry, pasting the code caused it to really mess up, even using the code container). Scroll to line: 160 (to 174) - this is the loop in question. i want to make it so this is the even part, and then so