<?php
$i = 0;
while(conditionals...) {
if($i == 0)
print "<p>Show this once</p>";
print "<p>display everytime</p>";
$i++;
}
?>
Would this only show "Show this once" the first time and only that time, and show the "display everytime" as long as the while loop goes thru?
...
I got this class:
Class Username {
protected $id;
protected $username;
protected $contact_information;
private __construct($id) {
$this->id = (int) $id; // Forces it to be a string
$contact_information = new ContactInformation($this->id);
}
}
Class ContactInformation extends Username {
protected $mobile;
...
Hello,
I have two variables containing some html code, and another variable containing code for a html form. I am trying to expand a string within the second to pass it as a parameter to a function, however this causes some errors.
My make popup function is very simple:
function popup(htmlcode){
child1 = window.open ("about:blank");
c...
What can I do to display the result of this query in the fronted using the Joomla pagination?
<?php
$database =& JFactory::getDBO();
$sql = 'SELECT * FROM #__no_entreprise';
$database->setQuery( $sql );
$rows = $database->loadObjectList();
?
...
A good friend just sent me the following email
My father is putting together a proposal for a local college to start a center of innovation and technology. As part of that, he’s proposing they teach web design and web development. My question is in your opinion what are the “industry standard” tools for both web design and web develo...
hello guys,
am looking for a php api that can access social networks like facebook,myspace,orkut and so many more of them. I should be able to upload pictures and videos to my favourite social networking account and also post get updates from thems, change status, make comments and similar stuffs. Just wondering if there is anything lik...
I would like to be able to track views of an item in a way that I can see what items were the most viewed yesterday, last week or any given period.
How can I do that using either PHP or Rails? Is there a plugin for this in Rails, or is there a simple way of doing this using PHP/memcached?
...
I am trying to join two tables; the purpose being able to search and display event information for an artist that is entered by the user.
The tables are as follows:
artist table:
[id],[name]
events table:
[id],[artist_id],[venue_name],[city],[state],[date],[time]
I created a search engine, but what I want to do is when an artist name...
Hey guys,
I'm using XSLT and having great success, just got a couple of problems.
Warning: DOMDocument::loadXML() [domdocument.loadxml]: Entity 'Aring' not defined in Entity
Basically for some non-standard characters I am getting the above type of error. I really want to fix this once and for all. I know about character mapping but I ...
I want to quickly identify if a key is present in an array, to avoid throwing an error.
For example, I might have an array like this
$arr['f']['b']['g'] = array( 'a', 'b', 'c', ) ;
Or the array might not have any variables in $arr['f']['b'] at all:
$arr['f']['x'] = array() ;
How can I avoid repetition in a test when referencing th...
I am generating a simple form with php. The following code has been reduced to showcase the problem.
<?php
$blah = "<h1>Well</h1>"; $test = "<h2>Done</h2>";
echo '<script type="text/javascript" src="fetchlayers.js"></script>';
$formcode = "<form action=\"process.php\" method=\"post\" enctype=\"multipart/form-data \">"
. "<labe...
I'm using the jQuery library to have an ordered list with the ability to re-order items with drag and drop. I want to send the information of the order to the database and the next time you refresh the page (or load it on another browser/computer) it would have your order.
I have a table for each element of the list in mySQL and right n...
The following code continues to be displayed even if there are entries in my database and I don't understand why. Am I missing something? I'm not sure if this makes sense, but help would be great. :)
if($numrows==0)
{
echo"<h3>Results</h3>";
echo"<p>Sorry, your search: "".$escaped."" returned zero results</p>";
}
...
I am trying to use the following code, to display $formcode, which is the html code for a form, in a popup windows. I understand that it is not an ideal method, but I want to understand why it is not working.
<?php
$blah = "Well"; $test = "Done";
echo '<script type="text/javascript" src="fetchlayers.js"></script>';
$formcode = "<form ac...
I have the following code to open a form in a popup window. I want to, after clicking the submit button, have an alert popup after 1250 milliseconds. This does not currently work as the page gets redirected to the result of submitting the form.
<?php
$blah = "Well"; $test = "Done";
echo '<script type="text/javascript" src="fetchlayers.j...
Is it possible to sort an array with Unicode / UTF-8 characters in PHP using a natural order algorithm? For example (the order in this array is correctly ordered):
$array = array
(
0 => 'Agile',
1 => 'Ágile',
2 => 'Àgile',
3 => 'Âgile',
4 => 'Ägile',
5 => 'Ãgile',
6 => 'Test',
);
If I try with asort($array)...
I'm trying to figure out the best way to implement an AJAX-y slider on the control panel of a WordPress widget. Because the sidebar admin itself is AJAX, I want to make sure that my solution doesn't conflict with what's already in place. The goal of the slider is to default to basic options but allow the user to opt-in to advanced option...
Can someone explain to me what exactly is so bad about using the backslash as the namespace operator for PHP6? It's impossible to read any discussion about PHP6 these days without someone making some scoffing remark about it. One StackOverflower even said that he gave up PHP because of it.
Yes I know that backslash has special meaning a...
First of all, I am assuming this is NOT bad practice due to various popular software using this method, such as SMF.
Anyway, so I currently have this code:
<?php
// main visual config
$cfg['lang'] = 'en';
// paths
$path['admin'] = 'index.php?p=admin';
$path['admin2'] = 'zvfpcms/admin';
$path['root'] = 'zvfpcms';
$path['images'] ...
I need to remove a single character from a string, eg in the text block below I would need to be able to remove ONE of the j's.
djriojnrwadoiaushd
leaving:
driojnrwadoiaushd
...