Hi there,
I am just starting out in the PHP world. I have used asp.net mvc and come from a VS 2008 background..
I looked at PHP and it seems that a lot of the code is mixed in with the html... so I was looking for something to manage separation... I found
http://kohanaphp.com/home
but being a complete beginner in this i am unsure if...
Is there some way to add ID attribute to every select element generated by Quickform_date so it would look for example like this?
<select id="date-d" name="date[d]">
<option value="1">01</option>
<option value="2">02</option>
...
<option value="31">31</option>
</select><select id="date-M" name="date[M]">
<option v...
Hello.
I am coding a friendship system and it has two tables.
members
id
username
password
friends
id
user_id
friend_id
status
Let's say that i want a query that can select the friends IDs of the member $userId how possible to make this in one query?
I found a solution which is to make 2 queries. The fist selects the friends W...
Hi,
I know PHP 6 will have unicode support for all build-in functions like strlen(). If this is the case, then counting the number of bytes in a variable can't be done with strlen() anymore. So, this will break probably some software? I'm curious, is the proper fix to do the following?
$bytes = strlen((binary) $var);
...
Hello, my question is the following
How can I display a standard rss page after posting a form
The problem I am having, is that it is not recognized as a feed if I use the forms action
to get to the function that should echo out the rss/xml.
If I use a direct link that is pointing to the function like controller/function I am getting ...
I'm working on releasing a PHP framework I have been using for a few years
on github. Been trying to read up on the most correct way a project
should be structured, what extra files such as readme's etc should be
added. Been coming up with blanks on google. Can anyone point me to a
project that's a good example or any good write ups.
...
I have a downloads directory on a website where I store a bunch of different files for people to download (zip, exe, java, php, etc). The problem is that my website is written in PHP, so the web server, Apache, tries to execute the scripts instead of letting people download them. Without having access to Apache config (I'm on shared host...
I have a classB which extends classA. In classB I define a method fooBar() which is also defined in classA. In fooBar() of classB I want to call fooBar() of classA at the beginning. Just the way I'm used to, from Objective-C. Is that possible in PHP? And if so, how?
...
I have a script and i d like to access to home directories of users in a Linux Environment.
Web root : /var/www/html/
And there are user directories such as : /home/john
/home/david
etc.
There are files in users home directories. The permissions of user homes belong to the users. eg:
/home/david/file.txt user: david group: david
Is i...
Is it allowed to implicitly assign instance variables to an instance?
That is, inside a method of a class that has no instance variables, can I just do this?
$this->foo = "foo";
$this->bar = "bar";
and later just call those again? Will PHP just create instance variables in this case?
...
Example: I have a $variable = "_foo", and I want to make absolutely sure that $variable does not start with an underscore "_". How can I do that in PHP? Is there some access to the char array behind the string?
...
Lets say I have an abstract ParentClass and a ChildClass. ChildClass extends ParentClass. Now ParentClass has got this nice constructor:
function __construct($tplFile) {
$this->$tplFile = $tplFile;
}
Will ChildClass automatically inherit this one? And if I don't add any constructor to ChildClass, will I be able to say $foo = new C...
I mean: Are there any things I can't implement in an abstract class? Like: Can an abstract class have a constructor, which just gets inherited by any child class? Or is the only limitation that I just can't say new AbstractClass(); ?
...
PLEASE NO JS!!!
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
</select>
I simply want that whenever someone selects "saab", the page would reload. It's kinda like having the whole <select> inside a form (which is the ultimate solution), but I need no "...
Is there an easy way to do this in PHP? How do you take plain text, formatted as XML, from a form textarea and have PHP take it in as XML? I can find out how to walk the tree after it's an XML object.
Just tried richsage's technique on this sample xml:
<?xml version="1.0"?>
<videocollection>
<title id="1">Tootsie</title>
<...
Since I've seen some pretty fun things done with social networking apis (The twitter image encoding project for example) I decided to try and make a CMS/Blog completely administered via a facebook page or group.
How can I:
Connect to a facebook account when the cms is installing and have it persistently connected (no need to re-auth)...
I have a form, and before it submits I want to check some of the input against a database. The idea: 1) submit form, 2) check values, 3) show error or actually submit the form. Example:
$(form).submit(function() {
$.post('check.php', {
values
}, function(res) {
// result I need before submitting form or showing an error
}...
When a user logins I get him/her's ID and save it in a session var. What I wonder is, is this the way to go? Or should I use cookies? so it automatically login and so on.
session_start();
ifcorrectlogin {
$_SESSION['id'] = mysql_result($loginQuery, 0, 'user_id');
}
how do you authenticate your users?
//Newbie
...
Hello all.
On my laptop I have an app that makes 7 AJAX GET requests to a single PHP script at about the same time (millisecond difference). They all return successfully with the result I want.
Then I moved this script to a server (Windows Server) running Apache and PHP. However, this process hangs when I make the same 7 AJAX requests....
Hi,
I have a jquery dialog modal box pop up for logging into my website. When a user clicks login it does a post request to a login.php file as follows:
$.post(
'includes/login.php',
{ user: username, pass: password },
onLogin,
'json' );
How do I do an md5 on that password before putting it in the post req...