I have a PHP class with a static function:
<? echo view::getUserSelector() ?>
Which outputs:
<div id="user_selector">
<div class="user">
<h1>Username1</h1>
<a href="javascript:selectUser(this);">select</a>
</div>
<div class="user">
<h1>Username2</h1>
<a href="javascript:selectUser(this);">s...
I'm creating a time off requester for my business and I think I've run into a small issue.
Goal:
I want to display a page that will show me if anyone has request the current day off.
Problem:
I have the date_from and date_to fields which contain the information of the start and end dates for each request off. However, and I apologize...
I don't know why every time I try to include my header using PHP’s include there's a top margin. I checked it using Firebug and it says there's a 22px offset margin on the top. Is anybody experiencing this problem? I think it's a CSS propiety: top: 22px. But nothing can change it even if I write h1 style="top: 0px; margin-top: 0px;". I t...
Hello.
I am building a basic link checker at work using cURL. My application has a function called getHeaders() that returns an array of HTTP headers:
function getHeaders($url) {
if(function_exists('curl_init')) {
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
...
I am going to develop a web portal. I have an option to choose a technology either PHP or ASP.NET. In terms of performance (not development speed) which will do better.
Coming to webserver, IIS vs Apache, which will perform better?
How many no. of requests/second can be handled by IIS?
How many no. of requests/second can be handled b...
Hi, I wish my users could select a directory from their PC and upload all files from this directory, so they could upload whole album(directory) instead of uploading every single file separately.
I would like to ask you if this is somehow possible using PHP or JavaScript and without using any framework.
thank you
...
Hi everybody,
First time reader, first time poster (woo!)
So I've been implementing my login scripts for an informal website. Not likely to be compromised, but just to be safe, I'd like to ask if there's a security risk in having my MySQL database login stored in plaintext in the php code.
As far as I know, the code itself is parsed b...
I want to write a script in PHP and javascript and somehow protect my source code so that I can sell my script.
I am looking for ideas how to protect my script. If I sell it to someone, how can I stop that person from redistributing it as their product?
I know there is ZEND and ionCube, but are there any other methods? As I don't like...
I have APC installed via cPanel everything worked just fine until I set new MySQL root password.
After MySQL root password changed my web sites hosted on this box resulting blank page.
When I disable APC everything works fine, so I guess problem is APC related.
reinstall APC via cPanel does not help.
Q1: does APC need MySQL root pass...
Can anyone tell me what is wrong with this? The file is renamed using a time stamp but the extension doesn't get extracted and placed in the new name.
$filenameext = pathinfo($filename, PATHINFO_EXTENSION);
$today = getdate();
$uniqueStr = $today[year];
$uniqueStr .= $today[mon];
$uniqueStr .= $today[wday];
$uni...
The getClientIP( ) method that comes with CakePHP is returning private IPs sometimes. For example IPs like 127.0.0.1 or 192.x.x.x. I assume this is caused by proxies.
Looking at the getClientIP( ) code it does seem like it tries to deal with proxies issues but it doesn't really check if the IP is private or not.
What would be the best ...
The php page is called page.php; this pages has 2 submit forms on it: form1 and form2. When one of the form's submit button is pressed what in the HTML header with identify which form was submitted?
...
Hi, I have two arrays...
$arr1 = array(
'name',
'date' => array('default' => '2009-06-13', 'format' => 'short'),
'address',
'zipcode' => array('default' => 12345, 'hidden' => true)
);
$arr2 = array(
'name',
'language',
'date' => array('format' => 'long', 'hidden' => true),
'zipcode' => array('hidden' => ...
I'm new to OOP and want to revamp this function to get rid of using globals.
function CatchListing() {
$parseform = array('itemnum','msrp','edprice','itemtype','box','box2','box25','box3','box4','box5','box6','box7','itemcolor','link');
foreach ($parseform as $globalName) {
$GLOBALS[$globalName] = mysql_real_escape_s...
In my code I'm getting data (three columns) from a sql db and I want to store the rows in an associative PHP array. The array must be multi-dimensional because I want to use the row id from the database as a key so that i can fetch values like this:
$products["f84jjg"]["name"]
$products["245"]["code"]
I've tried using the foll...
I'm trying to make some ajax-functionality in my web application, but I cannot get all puzzle pieces to fit:
I want to add a link that, when clicked upon, will open a new input (text) field that can be filled by the user. In the back-end, I want to do some administration that the link is clicked.
I want to do according to the Zend Fram...
Newb here trying to fix my php code. Getting an error at line 89.
<?php
/**
* @version $Id: index.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been ...
In an XML document, I have elements which share the same name, but the value of an attribute defines what type of data it is, and I want to select all of those elements which have a certain value from the document. Do I need to use XPath (and if so, could you suggest the right syntax) or is there a more elegant solution?
Here's some ex...
I am still looking into which one of these tools I should use. When I was poking around I noticed none of them really have any new releases:
Xinc
Version 2.0.1 released 02/05/08
Phing
Version 2.3.3 released 12/07/08
phpUnderControl
Version 0.4.4 released 08/09/08
Should I choose phpUnderControl because it had the latest release and de...
Is it posible,
to modify or edit txt file,
if the file's permission is set as 606 ,
via WEB browser ,
by normal users ?
I mean I make a txt file named "1.txt"
The first original contents of the txt file is "PAX is great man"
and then ,I upload this file to server.
I set the permission of the file as 606.
so the general users can n...