php

Need to Bulletproof this PHP include. Getting Failed to Open Stream

I've got some functions in my file that require taxonomy.php to execute. I'm attempting to include the file like so...(this is called from functions.php, which is located in wp_content/themes/mytheme/ include($_SERVER['DOCUMENT_ROOT'] .'/wp-admin/includes/taxonomy.php'); However, depending on the particular server setup, its hit or mi...

sort an array and assign new numerical keys?

i have an array like this (after i unset some elements): $array[3] = 'apple'; $array[5] = 'pear'; $array[23] = 'banana'; which function do i use to sort them to: $array[0] = 'apple'; $array[1] = 'pear'; $array[2] = 'banana'; i tried some of the sort functions but it didnt work. ...

store video in a mysql database, allow user download

I need a multimedia database I want to be able to upload video directly to the database Allow user to search database and then download as file when found shared host with php and mysql ...

SQL Query to pull records from 2 tables related to each other - Table 2 depending upon Table 1

Hi all, I have 2 tables. Table 1 is 'articles' and Table 2 is 'article_categories'. When a user creates an article, it is stored into 'articles'. The user, while creating the article can select various categories under which this article can appear. Currently, an article can be selected to belong to anywhere from 10-25 categories(may be ...

Is it worth learning Python over Ruby and PHP for Web Development?

Is it worth learning Python over Ruby and PHP for Web Development? If so why? Thank you in advance. EDIT: Related on StackOverflow: Should I learn Ruby or Python? Django or RoR Rails or Django? (or something else?) Ruby on Rails versus Python What are the biggest differences between Python and Ruby from a philosophical perspective ...

row order when inserting multplie rows in MySQL

In PHP, I create and execute SQL queries like the following. INSERT INTO Table (Column1, Column2, Column3) VALUES ('1', '2', '3'), ('A', 'B', 'C'), ('AA', 'BB', 'CC'); However, the order in which they are inserted into the database is different every time I try this. Is there a way that I can ensure that they are inserted in the order...

php - recreate array?

I've "inherited" some data, which I'm trying to clean up. The array is from a database which, apparently, had no keys. The array itself, is pretty long, so I'm simplifying things for this post... [0] => Array ( [id] => 2 [uid] => 130 [eid] => 8 [ename] => Standard [...

There are two columns in the new table(table1 join table2) which have the same column name, how to get the values of both respectively

select * from table1 join table2 on table1.column3=table2.column4 where ... ... $row=mysql_fetch_assoc($result); However, there are two columns in the new table(table1 join table2) which have the same column name, how to get the values of both respectively? ...

using Ubuntu commands in php

Is it possible to use ubuntu terminal commands in php program.for example i need to create a folder and compress (.zip) it using php program. How to code this need? ...

Configure MercuryC mail server - Can't see MercuryC SMTP Client in Configuration menu

I'm using MercuryC 4.6 and XAMPP to set up a mail server so that I can send mail form localhost using PHP. But I can not see the MercuryC SMTP Client in Configuration menu. Pls help me to solve the problem! ...

How to create a TIFF file?

How to create a TIFF file in PHP? I want create a TIFF file and fax it. I know how to fax it but I don`t know how to create a TIFF file. ...

searching integers using fulltext search in mysql

Iam using fulltext search in my php file using mysql.But its not giving any result for integers like "Timber Jane 10". My requirement is to get exact search, that is, if I search a full name it should give exact matches which contains those words and in the order of best match in descending order no matter if the searched phrase is a t...

html form calls on a php file.. but variables are not read

I have a simple html file with the code below. It calls submitform.php. But nothing gets displayed. Any ideas? <html> <body> <form action=submitform.php method=GET> First Name: <input type=text name=first_name size=25 maxlength=25> Last Name: <input type=text name=last_name size=25 maxlength=25> <p> <input type=submit> </form> </body...

Open PDF in a new window on image click

I want to open a PDF file in a new browser window when user clicks on the image. I saw the other links but not found what I am looking for. Any PHP/HTML way to do this? ...

how to write a code to protect the email IDs displayed on a page through PHP to protect from spam bots

I am displaying the email addresses stored in the database on a page using PHP. The email address on a page is displayed as below: Email: [email protected] Now the email address shown on a page should use JS spam protection to hide it from spam bots. ...

How to properly calculate the amount of levels in an array?

I have a function that has to accept an array of points, or an array of array of points (a 2 or 3 dimensional array). I'm looking for an reliable way to detect whether it has 2 or 3 levels. The thing is, I cannot count on the keys of the arrays to do the checking, so this wont work: $levels = isset($array[0][0]) && is_array($array[0][0]...

how to send many emails in one time by php

i want know how i can send one mail to 200 user and i want when the email sendt it appeare send to:[email protected] from:my mail because i think i see many email like that to:[email protected];[email protected];[email protected]; ithink this from bbc i mean i want every user see sent to this email only ...

send mail by bbc not working

hay i used this code $to = "[email protected],[email protected]"; $subject = "Mini-mass Emailer"; $message = "<a href='#'>Hello World</a>"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Your Name <[email protected]>' . "\r\n"; $headers .= 'Bcc: {$to}' . "\...

PHP: Array elements with a certain key

Hi all, I have a PHP array like this (sans syntax): array ( ['one'] => array ( ['wantedkey'] => 5 ['otherkey1'] => 6 ['otherkey2'] => 7 ) ['two'] => => array ( ['otherkey1'] => 5 ['otherkey2'] => 6...

Improving MVC usage

I'm busy building an MVC application in PHP using Kohana MVC framework, and it works very well. But there are some small annoyances which I'd like to address. A lot of logic is repeated across actions in controllers and controllers themselves. I've been thinking about it, and I thought it would be smart to define an object which contain...