I've tested this and it works fine, but it looks... weird... to me. Should I be concerned that this is nonstandard form which will be dropped in a future version of PHP, or that it may stop working? I've always had a default case as the final case, never as the first case...
switch($kind)
{
default:
// The kind wasn't valid, se...
I've just decided to venture off into PHP land for fun and to learn, reading that php is loosely typed and that $var's can be reused is this true that the code below will pose no problem?
$x = 996;
$x = mysql_query("SELECT aString FROM table1");
the variable x will stored as an int datatype with 996, then after the second line it wil...
Hi ,
If I made my PHP code which would connect me to my MySQL database in a separate PHP file and made a require on the necessary pages of my website would the DB Connent PHP file be an Object Orentated item ?
...
What does the operator => mean in the following code?
foreach ($user_list as $user => $pass)
The code is a comment at PHP.net.
The user does not specify the value of $user_list, $user nor $pass.
I normally see that => means equal or greater than.
However, I am not sure about its purpose here because it is not assigned.
I read the cod...
My site is gzipped compressed, and it doesn't load properly in IE. It works fine in FF/Chrome, but in IE, the only thing that pops up is a box asking to download the .gz file which contains the html document for the page.
Is this normal? Do I have to turn off gzip?
...
I'm using someone elses class and that person has defined a function with five arguments.
in Sentry.php:
function checkLogin($user = '',$pass = '',$group = 10,$goodRedirect = '',$badRedirect = '')
If all five fields are filled in this leads to a login procedure.
Now on the page where he explains how to use this there is a snippet wh...
I have 2 forms on a single page. One of the forms has a recaptcha displaying all the time. The other should display a recaptcha only after a certain event such as maxing out login attempts. So there are times when I would need 2 recaptchas to appear on the same page. Is this possible? I know I could probably use a single one for bot...
I know this has been covered before but I cannot find an answer to this,
I have always used this;
header("Location: http://www.website.com/");
exit();
This has always worked in my current project and all of a sudden it is not working in any of my browsers
I would like to figure out the problem and fix it instead of using
echo "<scr...
I have a nested list that lists child nodes when the parent node is expanded. The parent node is expanded by clicking an image to the left of the text.
Unfortunately, it expands right off the page. I would like a scrollbar to appear when the content is off the page.
When I set "overflow: auto", a scrollbar never pops up, it just ...
I'm trying everything I can to get phpdocumentor to allow me to use the DocBook tutorial format to supplement the documentation it creates:
I am using Eclipse
I've installed phpDocumentor via PEAR on an OSX machine
I can run and auto generate code from my php classes
It won't format Tutorials - I can't find a solution
I've tried movi...
If my code looks like:
if($seconds < 60)
$interval = "$seconds seconds ago";
else
if($seconds < 3600)
$interval = floor($seconds / 60) . "minutes ago";
else
if($seconds < 86400)
$interval = floor($seconds / 3600) . "hours ago";
else
$interval = floor($seconds / 86400) . "days ago";
How would I get rid...
Normally when I want to run a php script from the command line I just create a php page, add a shebang pointing to the php binary, then ./file.php to run it. Since I have php installed as an apache module, I'm not even sure what my shebang should look like. Any ideas?
...
I'm making a forum.
And I'm wondering if i should store the number of replies in the topic table or count the posts of the topic?
How much slower will it be if i use sql and count them? Lets say i have a billion posts.
Will it be much slower? Im not planning on being that big but what if? How much slower would i be compared to stroing t...
How do I make it so people can't use an input more than once every minute?
How can I remove the ability to put any non-char/number characters into a submit thing? Alphabet will work and so will numbers but +,-,), etc, won't?
...
I just enabled error reporting and wow what a shocker I have probably thousands if not hundreds of notices like this
Notice: Undefined index: action in C:\webserver\htdocs\header.inc.php on line 18
I understand that they are because I am calling a variable withoutsetting it or whatever but is there an easiar way to set for example if a...
I put "username" and "password" to a form of mine. The action starts up a handler.php.
The user sees then only a white page (handler.page) if he does not reload his browser at handler.php. If he does, the handler puts him to back to index.php.
I would like to put the user automatically back to the homepage after being at handler.php wh...
I'm adding validation so if a post is in a particular category, it needs certain Custom Fields to be set.
This should be easy hooking wp_insert_post_data and admin_notices, but there is a redirect that causes the admin_notices callback to disappear.
OK - So I created a hack that uses the Session to store my error message across the red...
Hello,
I am looking for a way to display a button on my site for donations. If a user clicks it, they would be taken to a paypal page with all the necessary information on the donor's end already filled in. What is the best way to implement this in a PHP/Drupal environment? I already have a paypal account set up.
Thanks.
...
Hello All.
I currently am creating a book inventory system with CodeIgniter (am new to CodeIgniter) and I would like each of the books to have to have tags.
Currently, I have 4 tables:
Books
Tags
BooksTags (matches bookid to tagid)
Collections (series collection)
In the controller for the main view which will show all the books, I ...