Hi, i am trying to upload a file with upload.class and i need to overwrite the file when the user upload a new one. But instead of overwriting, he is putting photo_01, photo_02, etc...
The code:
$foto = new Upload($_FILES['photo']);
$fotot = new Upload($_FILES['photo']);
$fotot->image_resize = true;
$fot...
I am looking for a php pagination class, I have used a rather simple one in the past and it is no longer supported.
I was wondering if anyone had any recommendations ?
It seems pointless to build my own when there are probably so many good ones out there.
Thanks in advnace!
...
Hello..
I have my site on index.html made in html+css., at my index.html i have this div id "content", where you put in main content to the page, and there's a link at the menubar that src to page2.php. When you press on the link it goes to the page2.php, but i want it to display inside the < div "content".
In page2 i have Hello this is...
I'd like to place a directive in my theme's functions.php file which appends a classname to the wordpress body tag. Is there a built-in API method for this?
For example, my body tag code is...
<body <?php if(function_exists("body_class") && !is_404()){body_class();} else echo 'class="page default"'?>>
And it results in the following ...
Hello, It happened that I need to pick up PHP based open source CMS. I did a small research and found many candidates. CMS made simple seems to be right choice, but I am not sure what's the current state, I know it was widely used time ago. I need it to be fully compliant with web standarts, lightweight (especially interface). It needs t...
with $element->children() i cant get all the child elements of current element.
but how can i get all the parent elements for current element with simplexml?
lets say it looks like this:
<entity id=1>
<name>apple</name>
<entities>
<entity id=2>
<name>mac</name>
<entities>
<entity id=3>
...
I have a website where local bands can have a profile page, I'm implementing an upload system so that they can add songs to their profile.
I want to make sure that clever visitors to my website cannot download their songs.
I was thinking about uploading them to above the folder for my domain so that they cannot be accessed directly. Is...
Remember iwantsandy.com? It was quite popular for what it did. ANyways, I'm looking to do something similar, but my question is, how does one process incoming emails? Let's assuming I'm using PHP or maybe even Ruby to do this. I would need a way to process the emails and dump them into a DB or something. Ok fine, but my main question is ...
UPDATE:
All the methods given below doesn't
work for:
mysite.com?username=me&action=editpost
but only for:
mysite.com?action=editpost
I know how to detect if a particular GET method is in the url:
$username = $_GET['username'];
if ($username) {
// whatever
}
But how can I detect ...
I've noticed many sites are able to use a username or page title as an action. How is this done?
For example instead of www.example.com/users/my_username (where the users action is generic and responsible for fetching user data) how could I make this www.example.com/my_username?
Thanks very much.
...
i expect a long array containing integers
[3,7,7,7,7,1....]
but the overall distribution should be skewed and normal.
using random() generates a uniform distribution.....
...
I mean I want to understrand how to generate WSDL from my code
So I've rote
<?php
$soap = new SoapServer(null, array('uri' =>
'http://php.hoshmand.org/'));
$soap->addFunction('add');
$soap->handle();
function add($a, $b) {
return $a + $b;
}
?>
How to call it like a WSDL now?
...
The script below resides in my theme's functions.php file.
It is designed to show and fade an "update" div which comes on screen after each save event. Just asking if this is the best approach to take so that it only executes on save and is not constantly trying to run the jQuery...
<form method="post">
<?php
if ( $_REQUEST['saved']) ...
I'm looking for a comprehensive and well maintained wiki syntax Parser for PHP, does anybody know of one? I can find some really good parsers for markdown and bbcode but am having trouble with finding a decent wiki parser.
I prefer markdown myself, but I'm writing post functions for a CMS and I'd like to give end-users a choice.
I thou...
Ive got a url: http://dev.local/foodies/view?id=bluedaniel
and ive got in my bootstrap:
protected function _initRoute() {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production');
$router = new Zend_Controller_Router_Rewrite();
$router->addConfig($config, 'resources');
}
and
iv...
What does MYSQL mean in the following code.
require_once (MYSQL);
...
UPDATE2:
I think I got it now:
<?php
/*
* @name Lawler's algorithm PHP implementation
* @desc This algorithm calculates an optimal schedule of jobs to be
* processed on a single machine (in reversed order) while taking
* into consideration any precedence constraints.
* @author Richard Knop
*
*/
$jobs = array(1 => a...
I would like to add custom attributes to a MySQL table which I can read via php.
These attributes are not to interfere with the table itself - they are primarily accessed by php code during code generation time and these attributes HAVE to reside in the DB itself.
Something similar in concept to .NET reflection.
Does MySQL support any...
Looking for a good tutorial on how to update a mysql database using a php form?
...
How do I use the header redirect to make it redirect to the current page?
EDIT: I am trying to make it reload the currently shown page in the browser.
...