Why am I not able to get inside the while loop in the getCustomers() function?
$stores = $bl->getStoresForGuide($gID); //Returns 6 stores
$storelist = getStoreList($stores); //Generate the HTML for the store list
$brandlist = getCustomers($stores); //Generate the HTML for brand list
function getStoreList($stores)
{
while ...
Hello everybody,
I have a conditional statement which goes thusly:
if ($_POST['password'] == $_POST['repeat'] && $_SESSION['type'] == "admin")
But let's say I also want the conditional to evaluate true to users with type "superuser" (instead of "admin").
So I could, for example, write:
if ($_POST['password'] == $_POST['repeat'] && $...
Hi There!
How do you get actual host name, except for $_SERVER['SERVER_NAME']? Is there other way to get it ?
I create a function which gets host name from PATH.
I don't want to use $_SERVER['SERVER_NAME'] (You can do simple test via telnet) because it can be replaced by sending HTTP request (in headers) remotely via telnet or etc...
Any libraries for a basic chart reporting with flash and php code based on parameters we pass,
I know there is open flash chart, seems to be a slightly difficult to get that going.
Do you have any other alternative flash charts to suggest for a php code
...
The FILTER_VALIDATE_URL filter seems to have some trouble validating non-ASCII URLs:
var_dump(filter_var('http://pt.wikipedia.org/wiki/', FILTER_VALIDATE_URL)); // http://pt.wikipedia.org/wiki/
var_dump(filter_var('http://pt.wikipedia.org/wiki/Guimarães', FILTER_VALIDATE_URL)); // false
Why isn't the last URL correctly validated? And ...
I know this is not great practice, but I need a definition in order to get my real question answered.
I have an object like this:
class Car
{
public $wheel;
public $engine;
so on..
}
I instantiate and edit values like thus:
myCar = new Car();
myCar->wheels = 4;
myCar->engine = V8;
What is it called when I do this?:
myCar...
Say I have the URL of an image, is there an easy way to get it's height/width using PHP?
I'd prefer not to use javascript if possible.
...
I am creating a website in php with a form that teachers complete to tag each question on a test with a label. The labels are predetermined and listed in a set of drop down menus (one for each question on the test), but there is an option for users to click "add a new label" which pops up a another form in a new, smaller window (while ke...
I'm returning all rows in a table with a while statement and PHP. the rows indicate a list of items. I'd like to include delete links next to each item so users can delete the entries. I'm trying to figure how to go about it in PHP. Can anyone help me write the script.. I'm using procedural.. not OOP.
I'm thinking the link takes users to...
Pardon the dummy question, but I am trying to breakdown a bunch of web pages into subdomains and bring them up using a settings.php page.
The problem is that I can only find this for the settings page:
<?php
// WEBSITE Settings
// ******************************
// Domain Name (without: http://)
define('DOMAIN_NAME', 'mydomain.com');
...
The goal of this code, is to get all brands for all stores into one array, and output this to the screen. If a brand exists in multiple stores, it will only be added once.
But I feel I have too many for loops, and that it might choke the CPU on heavy traffic.
Is there a better solution to this?
function getBrands($stores, $bl)
{
...
My latest idea for do settings across my php project I am building was to store all my settings in a config PHP file, the php file will just return an array like this...
<?php
/**
* @Filename app-config.php
* @description Array to return to our config class
*/
return array(
'db_host' => 'localhost',
'db_name' => 'socialnetwor...
I'm using FOP to generate PDF files.
What's the best way to either include another PDF file in a PDF generated by FOP or to cook multiple PDF files together using PHP?
...
I cannot figure out what I am doing wrong here. The permissions for the directory I have for the file being created have write permissions all across the board. I keep getting "directory does not exist" Thanks for the help!
<?
//creates variables and calls the information from the server
$Name = $_POST['name'];
$desc = $_POST['desc'];
...
Not long ago I was playing around with GETEXT in PHP for language files and doing a lot of research on the best way to offer multilingual support in a PHP app, it seems the general consensus was to use GETEXT instead of arrays or constants or any of the other options.
I often look over big name projects code like wordpress, vbulletin...
For now, i have a function macs, and i need to implement this function to save inside a cookie and have it stored in mysql..
So how am i supposed to have this function together?
<script language="JavaScript">
function getMacAddress(){
document.macaddressapplet.setSep( "-" );
return (document.macaddr...
I am currently building an web app using mostly PHP and JavaScript. What is the best way to design an app so that it is easy to make it available in multiple languages? Originally it will only be in English but I may want to make it available in other languages in the future.
...
I'm making a review type website, and I would like for there to be 2 types of users. One would be the majority, reviewers while the other would be the person the review is about. How, in terms of database design would I differentiate the two. Should I have separate tables for reviewers and reviewies or simply assign a different range ...
I have read many times on the web that when dealing with dependency in PHP that it is good to use dependency injection instead of Globals because it makes it easiar to test. Can someone explain how this make it easiar to test? And what I would use to do the test?
...
Hi there,
I am working on a site and just published it to the client's domain, but when I try to access the root or subpages, they download to my computer rather than displaying as the pages. Could it be the fact php is not installed (the server is managed by my client so I don't know if PHP is installed)?
Thanks,
Elliott
...