Is it possible to tell to linux cp command which files to overwrite via PHP? Basically, I have searched the conflicts between the source and the destination folders, asked the user what files to overwrite and put them on an array. Now I want to copy the files, overwriting only the files on the array. Answer C…
Tag: php
Database design: implementing several types of the same entity
I’m coding a Classified Ads web application. The application has several types of Ads: General ads(electronics, toys, pets, books…) Real estate (houses, apartments, terrains…) Vehicles (motocycles, cars, vans, trucks…) Each type has several common fields (id, title, description) and al…
Spanish Characters not Displaying Correctly
I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8: I have also made sure that the page header is set for utf-8 also: Here is the beginning stages of my code thus far: The above code is in a
Get Specific Device Information
Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else’s? The only solution I have so far is to use $_SERVER[‘REMOTE_PORT’ in conjunction with $_SERVER[&…
Preserving session variables across different domains
I’m not sure if this is even possible. My company has their main site that accept credit cards and other payment information. They also have other sites that are directly related to events we host. …
Spl, ArrayObject, ArrayObject::STD_PROP_LIST
I’m trying to understand STD_PROP_LIST constant in the documentation but so far i didn´t understand it, and didn´t found any explanation 🙁 The documentation has the following example: Both prints give me the same exact result: Anyone could help me understanding what is the difference between using this …
move_uploaded_file() failed to open stream: no such file or directory
I’ve done your standard checks (is the directory there, are lax enough permissions set), and I’m pretty sure I’ve covered your standard stupid human tricks. Here’s the code that’s failing: The directory is there – I copied the path from FileZilla. I even set the permissions…
Risk of using $_SERVER[‘REQUEST_URI’] or $_SERVER[‘PHP_SELF’] in forms and links
Is there any risk of using $_SERVER[‘REQUEST_URI’] or $_SERVER[‘PHP_SELF’] as the action in a form or as the href in a link? If so, what can be done to alleviate the risk?
Get previous week number from php week number
I currently need to get the previous week from a variable that passes a php week number so if it is week 13 I will get week 12. The problem I am facing is that if I just minus 1 from the original number if I am in week 1 it will return week 0 unless I create an if
Using isset() inside a foreach doesn’t work?
Basically, I have an indefinite number of buttons that I want to generate from variables held in the mysql database. Now when I try to press the buttons nothing happens. This is the code I thought might work for that: There are no errors. I think it’s because I can’t use isset inside a foreach thi…