php

Trying to check if html text box is empty using php

I have this code to verify whether an html text box is empty or not. But I can't figure out what common with admission time and address, that they don't seem to work. The code is not reading them even if I have inputted a data on them: <html> <head> <title>Admission Information Sheet</title> <meta http-equiv="Content-Type" conte...

validation page error

hye guys.. i have a problem where i did'nt knw what the error i have validate page where its checks the group to identify the user if the group is admin, the adminpage will appear.. while if the group is user, the userpage will appear.. situation:when i insert the username and password, the validate page appear with the blank page...i do...

simplexml_load_file and $_SESSION

Hi everyone, I have a problem using simplexml_load_file and session vars in PHP. So, I have 2 PHP files, one generates some XML and the other one reads it. The file that generates XML should read some $_SESSION vars, which had been set in the other, but it won't... For instance, say the first file is something like: FILE 1 (reads XM...

Built in PHP function that does this?

foreach($array as $key => $value) if (strlen($value) == 0) unset($array[$key]); theres so many built-in array functions so is there one that does this? ...

I'm getting a php warning: cannot modify header information (but I have my include file before the html code!)

I'm getting this: Warning: Cannot modify header information - headers already sent by (output started at /www/zxq.net/a/l/e/alexchen/htdocs/index.php:12) in /www/zxq.net/a/l/e/alexchen/htdocs/common.php on line 13 right on my h2 tag. I have my common.php before the html code. I don't know what the problem is. Help! i...

Is there any tool create php proxy class for web service (wsdl)?

Hi Is there any tool for generating php proxy classes for webservice for php programming language? Web services are developed in .net. ThanksnRk ...

Secure a script from outside access?

Ok, here is the problem. I have a facebook application where users can earn points for completing surveys. When the user has completed the survey, at the end of the survey a tracking pixel is fired to credit the users account. The pixel loads a script like the one below: http://www.mysite.com/fb/add-credit.php?userid=&lt;fbid&gt; I w...

PHP capturing line numbers?

I'm building a basic error logging feature in my application, where I just record a custom message like "product ID was missing" and record it in the DB. Is there any way I can dynamically capture from which class or function the error was triggered (ie the function from where log_error() was called), or the line number? ...

how i can make the Revenue Sharing system by php

How can I show something on 75% of requests, so that on average, every four page requests would result in three pages showing it, and one not. this is a translation of this question!... i dont know how it working with 70% now how i can show in example echo iam; in a page in 70% percent this mean it will appear 3 tim...

Isn't Using the basename function with $_FILES['userFile']['name'] Redundant?

According to the POST method uploads section of the PHP Manual, $_FILES['userfile']['name'] is the original name of the file on the client machine. Example #2 in that section uses the basename function with $_FILES['userfile']['name'] like the following: $uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . basename($_FILES['user...

PHP: if !empty & empty

Hello. So i have this form.. With 2 fields. "Youtube" and "link" I want to do if you have filled in YouTube, it should do this: if(!empty($youtube)) { if ($pos === false) { echo "Du skal indtaste youtube et URL, som starter med 'http://www.youtube.com/watch?..&lt;br&gt;"; echo "<br> Har du ikke din video på YouTube, skal du ikke udf...

Compare date in php

Task: I need to check the current time with a respective time fixed by the admin, if the current time crosses the respective time, will update status 1) How can i convert the respective date to unix timestamp ? TIME STAMP: 1267285500 for DATE: 2 / 27 / 2010 @ 9:45:0 so that i can compare the unix timestamps of the current time and ...

form echoes success without submittting anything to database. Is there something wrong with my flow control?

Here is the code. I really dont why it is not submitting my information. <?php //Includes mass includes containing all the files needed to execute the full script //Also shows homepage elements without customs include ("includes/mass.php"); //Grabbing data form POST array and storing in variables plus the date $username = ($_PO...

Include_Path Zend_Framework

Error: [2] require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory /var/www/vhosts/localhost/httpdocs/public.:./var/www/vhosts/localhost/httpdocs/public/../library:./var/www/vhosts/localhost/httpdocs/public/../model:. defined('SITE_ROOT') ? null : define('SITE_ROOT',$_SERV...

How can I display a language according to the user's browser's language inside this code?

How can I display a language according to the user's browser's language inside this mini-framework for my multilingual website? Basically, it has to display the default language of the user if there's no cookies. Example of index.php: (rendered output) <h2><?php echo l('tagline_h2'); ?></h2> common.php: (controller of which languag...

How to change list to CSV, and vice versa, in PHP.

I have a text file like.... [email protected] [email protected] [email protected] [email protected] [email protected] I want to convert it to CSV with the help of a little bit PHP, and I want to know also how it can be reversed...ie from CSV to an ordered, or un-ordered list.....kindly help me please :) ...

PHP loop that runs beyond browser disconnection?

I want to have a simple PHP script that loops to do something every ten minutes. It would be hosted offsite, and I would activate it via my browser. I don't have access to the server other than my web space, so 'cron' as such isn't an option. (I'm happy to have this stop after a certain time or number of job cycles. I just need it to...

how to get value from the database

i want to get value from database..for exmaple,in the name field, it show the name that stored in the database. i want to show the value in the respective field.but it cannot retrieve the value..plz guys..help me <?php session_start(); $username = $_SESSION["username"]; $department = $_SESSION["department"]; ?> <html> <hea...

get everything inside/between html tags

Hi, what is the best way to get some html elements + values? example: <div id="abc" class="classs"> <img src="pic1.png" alt="pico"> <img src="pic2.png" alt="nano"> </div> what I have is the id=abc of the div element. I want to get everything inside the div element like: class of the div ("classs") src of the pictures and oth...

Running a list of MySQL queries without using exec()

I've got a site that requires manual creation of the database tables on install. At the moment they are saved (along with any initial data) in a collection of .sql files. I've tried to auto-create using exec() with CLI MySQL and while it works on a few platforms it's fairly flakey and I don't really like doing it this way, plus it is h...