php

Red Hat file include problem, PHP / APACHE

I have a Red Hat Linux box that I did not configure but must get a custom PHP application working on it. This is the error I am getting. I am essentially just trying to include include.php into a file test.php which resides in the same folder. I get the below error. Warning: require(include.php) [function.require]: failed to open stre...

Is there a fast way to check if a variable belongs to a set?

Hi, I have a form and I need to check if a input belongs to enum(0,1,2,3,..,n) Is there a simple way to check if my variable belongs to the set [0:n] ? Or do I have to write each condition (basically n<10, so it's feasible but not that practicle...)? If there ain't native function to do that, could you give me a hint on how to make a f...

CSV Export Script only generates error in IE?

I have a CSV export script (enrdata_arch.php) which calls information from an existing database and exports it into CSV format. For some reason however, the script returns the following error ONLY in Internet Explorer: Microsoft Office Excel cannot access the file 'https://www.domain.com/admin/enrdata_arch.php'. There are several possib...

Question about a line feed (newline) in php/html

Hi, I have this code/text below is sent when a user reset the password of an account: E-mail: <?php echo $sfGuardUser->getEmailAddress(); ?> Contraseña: <?php echo $password; ?> The problem: in the received email this is showed: http://img689.imageshack.us/img689/357/48099429.jpg I have tried this: E-mail: <?php echo $sfGuardUser...

Model Database class required (PHP/MySQL)

Hi, I'm after a model-based database class for PHP/MySQL. But it must have one particular functionality: Once the class is initialised ( e.g $user=new User(); ) I should be able to access the attributes in the user table as follows: $user->name // returns the value of the 'name' field in the user table I should not have to define the...

What is the best way to send a secure email in PHP

I wrote a PHP script which will run every Monday using cron. In this email I am attaching an XLS document which contains sensitive information. What is the best way to secure this email? Can I set a password on the XLS document? Can I encrypt the email and only allow the correct receiver to have authorization to open it? I am using PHPE...

how can search between 2 listbox in php?

Hi every body i want to search between 2 list box like "from and to". plz help me ...

Submit image in a <form> to a different domain?

Hi, I've got a web project where my users signup at a url like: www.mysite.com/signup/index.jsp after the user signs up, I show them another page where they can submit a user photo if they want. But my user photos are going to be hosted at another domain I own - is it possible to post a form to another domain? Like the page they land...

Small/efficient PHP database options

Subjective question, I know, but I am counting outgoing clicks for a very specific part of a website, and I'm simply needing to keep a tally of outgoing clicks per link and per day. I know that I could use MySQL for this, but I am wondering if there is something smaller/more-efficient for this application. I manage my own server on sli...

Do i login using cookies or sessions in a login system?

Do i login using cookies or sessions in a login system? I've seen examples using sessions and cookies so i am confused! Can someone please explain this? What do most sites use? love to know! Thanks in advance;-) ...

Transfer images between servers?

Hi, I have a java servlet which accepts an image a user uploads to my web app. I have another server (running php) which will host all the images. How can I get an image from my jsp server to my php server? The flow would be something like: public class ServletImgUpload extends HttpServlet { public void doPost(HttpServletReque...

Apache config for PHP and Django

I'm wanting to run PHP and Django together on the same apache config and I'm wondering how to do that? devserver.com <- Serving PHP files from /var/www devserver.com/django <- Serving Django from /var/www/django (/var/www/django/mod.wsgi) Any idea how to do this? ...

URL filtering in php, filter_var or htmlentities

Hi; For a secure url query, what is more secure? filter_var($string, FILTER_SANITIZE_SPECIAL_CHARS) or htmlentities ? thanks in advance ...

Prevent PHP require_once from ever running

Debugging someone else's PHP code, I'd like to selectively override one of their classes. The class is included via: require_once('classname.php'); But, that appears in various places in the application. I'd rather 'simulate' the require_once, so that it never gets run at all. I.e. just define class classname as I want it. Then, t...

strtotime() weirdness with first and last

$day = date('l', strtotime('07/25/2010')); echo "$day "; echo date("m/d/Y", strtotime("first $day")); This prints out Sunday 07/11/2010 $day = date('l', strtotime('07/25/2010')); echo "$day "; echo date("m/d/Y", strtotime("last $day")); This prints out Sunday 07/04/2010 What's going on here? Shouldn't it be 07/04/2010 and 07/25/201...

PHP switching tabs in browsers causes session not work and must relogin

Hello, I have a password protected area of a site that I use Sessions to allow the user to move from page to page of the protected area. However if I open new tab YET keep the other tab open (the one in the protected area) and then do somethings in the new tab and switch back then to the old tab I am forced to re login. I have tried set...

php xpath: query within a query result

Hello. I'm trying to parse an html file. The idea is to fetch the span's with title and desc classes and to fetch their information in each div that has the attribute class='thebest'. here is my code: <?php $example=<<<KFIR <html> <head> <title>test</title> </head> <body> <div class="a">moshe1 <div class="aa">haim</div> </div> <di...

Wordpress: get author info from post id

Or even the author id from the post id. I am trying to return the author meta (author page link and avatar) in the sidebar of a single post page (outside of the post loop). What is the best way to do this? I am using a custom function (see below) to return the post id, but am not sure what function to call next. function this_post_id() ...

Grab content from another website.

Hi! I want to grab anything thats inside the code below on a website. <table class="eventResults byEvent vevent"></table> How can I accomplish this? Thanks ...

What is the maximum length of a String in PHP?

So how big can a $variable in PHP get? I've tried to test this, but I don't have enough system memory (~2gb). I figure there has to be some kind of limit. What happens when a string gets too large? Is it concatenated, or does PHP throw an exception? ...