Skip to content

Tag: php

preventing direct access to a php page, only access if redirected

I want to make my php page only accessible from another page redirect and prevent my user from accessing it directly. I mean, let’s say I have a page called “main.php” and another PHP file that I want to prevent direct access to, called “noaccess.php”. I want to make noaccess.php…

Get value of input box, without a form?

Does anyone know how I can get the value of an input box, without having a form? I want a submit button, but instead of submitting a form, I want it to change data in a MySQL database. Something like this maybe? Could I use that code on a “onclick” event? The input box’s name and id is &#822…

PHP fetch all Twitter Followers and compare them to friends

I am looking for scalable way to do the following: User login Fetch all Friends from Twitter Fetch all Followers from Twitter Display all Friends which aren’t Followers The Problem: How can this be done in a scalable way? An user can have up to 2 million friends or followers. Currently I’m storing…

Newbie – eclipse workflow (PHP development)

this is a bit of a newbie question but hoping I can get some guidance. I’ve been playing around with Eclipse for a couple months yet I’m still not completely comfortable with my setup and it seems like every time I install it to a new system I end up with different results. What I’m hoping t…

php fputcsv and enclosing fields

I was just about to ask the same questions as the question aksed here…. Forcing fputcsv to Use Enclosure For *all* Fields The question was When I use fputcsv to write out a line to an open …

mysql get last auto increment value

Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next ‘jobnumber’ . But I want to do …

PHP Sort Array By SubArray Value

I have the following array structure: What is the best way to order the array in an incremental way, based on the optionNumber? So the results look like: Answer Use usort. In PHP ≥5.3, you should use an anonymous function instead: Note that both code above assume $a[‘optionNumber’] is an integer. …