Hay guys, I'm writing a PHP application to take a NZB file, grab the Yenc files from that, download them, then combine them, then decode them back into binary state.
I've managed the first part, but I'm having trouble combining the Yenc files back into 1 Yenc file.
any ideas?
Thanks
...
When looking at the accepted answer of stripping out all characters from a string, leaving numbers, the author added a + after the expression
$str = preg_replace('/[^0-9.]+/', '', $str);
in order to find sub-strings, instead of single occurrences, to remove. For the functionality the + is optional. But I started to wonder whether addi...
Hi,
I'm trying to setup a Search Results page with two columns. First column will present results from all categories except one (Galleries), and the Second column will present only the Galleries category.
query_posts() simply resets my results. This is what I got so far. Broken:
<?php
$s = get_query_var('s');
...
I'm sending email with phpmailer, everything is fine but when I recieve the email in the
part that has email from, I get Webmaster as I set it and in brackets I get the full googlemail email address. (i'm using google mail smtp) to send mail,
I was just wondering if I can hide the googlemail email address somehow.
I'd like the cs@beaut...
Using CakePHP (On PHP 5.2.6) I do a list query on a table which returns an array like:
Array
(
[0] => None
[3] => Value 1
[5] => Value 2
)
Since it's not a sequential array json_encode() encodes it to an object instead of a JSON array which I need for filling a Jeditable Select.
PHP 5.2.6 does not support any additional parameters...
Hello everybody,
I am in the process of developing an academic toolkit for my university. The problem statement is, the user will be given a list of courses. When one clicks on that particular name of the course, he should get a dynamic slide panel showing the course objective and other details of that course. All these values will b...
I think the title is right but please correct me if It is mis-leading.
The problem: I have a class which wants to use the DB class, now instead of having to "global $db;" in every method I wish to use the DB object I want to be able to place the object reference in my class properties.
Still following? OK here goes:
class user
{
p...
Hey all,
I'm moving from the realm of just JS to php and Ajax. I've dabbled some with PHP in the past.
I really appreciate how much help stackoverflow has been in helping me with basic questions.
let says I have a div called #divName.
I use the following JS for Ajax. Some of this is just pseudo code.
var request = false;
try {
...
I have some code that isn't doing what I want it to in IE8. When you hit the "preview" submit button, a bit of Javascript jumps in and changes the form's action to franchisepreview.php. This sets a session variable so when you go back to the form you won't loose anything. Hitting "Update" or "Insert" goes straight to a query that inserts...
I'm debugging some PHP code written by an outsourcing company (I'm not a PHP guy at all but know the basics; we have an offshore team of PHP developers working for us on this project) that's not working; the code is supposed to be called every 30 minutes by a cron job but its not firing. I tried to run the PHP script via the command lin...
I'm totally aware of the aberration of Magic Quotes in PHP, how it is evil and I avoid them like pest, but what are magic_quotes_runtime? From php.ini:
Magic quotes for runtime-generated
data, e.g. data from SQL, from exec(),
etc.
Is is something I should check if ON and turn OFF with:
set_magic_quotes_runtime(false);
Is it ...
Hi there coders around the world,
I'm working on a project where users can do certain things and gain points for it. To simplify this question let's say we got 2 tables user and points.
-- table user -- table points
+---------------+ +-----------------------------+
| id | name | | id | points | user_id |
+--------...
Can someone show me how to make a If statement where if a drop down does not equal the default value of 0 (in my case) to automatically submit the form if possible?
session_start();
$current = isset($_SESSION['ClientNamefour']) ? $_SESSION['ClientNamefour'] : 0;
while ($row = mysql_fetch_array($result)) {
$id = $row["Client_Code"]...
I want to count the no. of times a image is being served from our server. I have some images in a website and want to count the no. when these images are showed on web pages(served from the server to my website and if hotlinked). Is there any way to accomplish this. I know php so if there is some way doing it in php it would be really he...
$arr1=array(23,43,54);
$arr2=array(34,23,3456,43,11,54);
I want to get elements of $arr2 that's not in $arr1
...
I run into this problem periodically, and I'm trying to figure out if it's a configuration issue or a peculiarity with PHP.
Basically, there will be a function foo() defined somewhere in my code, and then elsewhere I will accidentally define a function again with the same name foo(). I would expect an error of some kind to be thrown, e....
I have two table fields in a MySQL table.
One is VARCHAR and is a "headline" for a classified (classifieds website).
The other is TEXT field which contains the "text" for the classified.
Two Questions:
How should I determine how to index these two fields? (what field-type, what classes to use etc)
Currently I have an "ad_id" as a uniq...
I was going through Questions every good .Net developer should be able to answer and was highly impressed with the content and approach of this question and so in the same spirit, I am asking this question for PHP Developer.
What questions do you think should a good PHP programmer be able to respond to?
EDIT : I am marking this questio...
Sorry for the confusing title....
We are developing an application to be used by multiple companies. For the most part, the application is the same, your standard sort of database manipulation pages (search pages, edit pages, etc.) customized for the data that it is designed for.
However, each company has a slightly different process, ...
How could I echo 5 elements randomly from an array of about 20?
Thanks.
...