Hi I have mybb installed on my website. I have also installed dompdf and its working in its own directory i.e. I have installed in “DOM” directory. Now I can easily general pdfs with this simple code ,…
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…
Styling a voting system
I have made a sample voting system here: Sample Voting System However after repeated attempts I couldn’t get it to style the way I want because the developer has used way too many divs here. Either …
usort descending
When i try to apply the below code from here it gives me results in ascending order. Output: On swapping $a and $b it gives the results in descending order except one value Output: i want to have the results in the below order: How do i achieve the same.? Answer My first guess is that usort expects an integer
How to extract images from a PDF in their original format
I’m using pdfimages -j bar.pdf /tmp/image to extract images from a PDF. My objective is to get them in their raw state as they were added. So If it was a .tif I’d like to get a .tif, if it’s a jpg I’d like to get a .jpg. I keep getting .ppm for everything I extract. Is it possible to