Skip to content

Tag: php

Save byte to file with php

I have a c# program with some bitmap datatypes which i would like to upload to my web server with HTTP. So i am thinking of converting the bitmap to the datatype bytes and then post it as text to the …

Undefined variable: id PHP

Can every explain or show me why i’m getting this Undefined variable: id. The function And calling the function. If someone can help me out it would be most appreciated Answer Check your $id whether it is set or not before calling your function. Do like this

HTML/PHP – Form – Input as array

I got a form like this I’d like to have as $_POST output an array like: I know I could do something like name=”levels[1][build_time]” and so on, but since these elements get added dynamically, it would be hard to add an index. Is there another way? As suggested, I changed my form. I also inc…

correct PHP headers for pdf file download

I’m really struggling to get my application to open a pdf when the user clicks on a link. So far the anchor tag redirects to a page which sends headers that are: this doesn’t seem to work, has anybody successfully sorted this problem in the past? Answer Example 2 on w3schools shows what you are tr…

Get WordPress Child Theme Path in WordPress

I have a parent and child theme. In my child theme I declared a variable CHILD_DIR so I can add custom JS and CSS files to the my child theme’s folder structure. I did this in my functions.php file in my child theme by doing this: This produces a URL which is what I want since I’m using it like

How return http_code 401 with PHP

I’m using cUrl in the client side. On my webservice (ws.php), i’ve this simple code : When i call this ws.php page, i still have http_code = 200. Here is my cUrl code is client side : $code = 200 even i put the header code “401”. Answer try this on your ws.php: Let me know if this work…