I am using Zend Framework(MVC part of it), and need to either redirect user to SSL enabled page or to force SSL from controller somehow and don't quite see how to do that? Maybe someone can share the knowledge?
Thanks!
...
EDIT: I've tagged this C in a hope to get more response. It's more the theory I'm interested in than a specific language implementation. So if you're a C coder please treat the following PHP as pseudo-code and feel free to respond with an answer written in C.
I am trying to speed up a PHP CLI script by having it execute its tasks in p...
i created a register page n login page 4 members in php n mysql.and also i created a admin account and now i want to do something like if the member register he will be added only when the administrator approves it.please help
...
I have the following piece of code which replaces "template markers" such as %POST_TITLE% with the contents of a variable called $post_title.
function replaceTags( $template, $newtext ) {
$template = preg_replace( '/%MYTAG%/', $newtext, $template );
return $template;
}
The issue is that when $post_full has a '$' in it, the ret...
I am new to the Mac world and I'm looking for PHP development tools, right now the most important thing is the editor. Syntax highlighting and a file tree list are mandatory, of course, and code insight would be nice (of course :). I am hoping that there are free editors out there that provide these functionality and I hope someone could...
Is there a fast algorithm for finding the Largest Common Substring in two strings or is it an NPComplete problem?
In PHP, I can find a needle in a haystack:
<?php
if (strstr("there is a needle in a haystack", "needle")) {
echo "found<br>\n";
}
?>
I guess I could do this in a loop over one of the strings but that would be very ex...
Hello, I hava an ajax application that will not display an image, or make a popup window from html stored in a file.
This is the code I am usiong for the popup:
echo '<script>
function makewindows(){
child1 = window.open ("about:blank");
child1.document.write(' . json_encode($row2["ARTICLE_DESC"]) . ');
child1.document.close();
}
</s...
I want to test some PHP on my local machine running Windows XP Professional. I'm familiar with coding PHP for upload, but not with running a web server.
What is the easiest way to set up a test environment? Step-by-step instructions would be great if you can give them.
(I see WAMP recommended in this thread - thoughts?)
Update - a yea...
What is the best way to ascertain the length (in characters) of the longest element in an array?
I need to find the longest element in an array of option values for a select box so that I can set the width dynamically.
...
I am trying to find a way to get the source code for (user defined) PHP functions in a string.
For normal code this is easy, using reflection I can find the file and linenumbers where the function is defined, then I can open the file and read the function source code.
This will not work if a function is defined in eval'd code. I do not...
On a page I want to dynamically list years and all the months in each year so an archive for each month can be viewed. I want to show the current year first but the current year may not be over yet so I only want to show the months that have passed, and the current month. Then I want all years and all months in the past since this year (...
I am trying to create an array starting with today and going back the last 30 days with PHP and I am having trouble. I can estimate but I don’t know a good way of doing it and taking into account the number of days in the previous month etc. Does anyone have a good solution? I can’t get close but I need to make sure it is 100% accurate...
I have heard that uploading your website with FTP is now for n00bs, but it's the only way I've known how for the 8 or so years I've been building websites. Apparently all the buzz now is using a version control system, like SVN or Git, and somehow using SSH to upload only the files that have changed (if I understand correctly). I'm won...
My application needs to set cookies for specific paths in the application. For example (in php):
setcookie(*cookie_name*,*value*,*date*,"/subpath/subpath/unique_name");
setcookie(*cookie_name*,*value*,*date*,"/subpath/subpath/another unique name");
Oddly enough, the first setcookie works fine. The second doesn't generate an error and ...
I am looking for a small wiki engine that is easy to embed into an existing PHP application. Or perhaps a set of libraries to handle all the typical wiki functions.
Currently I am using ErfurtWiki, but it is starting to show its age. It hasn't been updated since 2005, and several of the pages on sourceforge appear to have been hacked....
I have a php script which accesses a MSSQL2005 database, reads some data from it and sends the results in a mail.
There are special characters in both some column names (I know, it's terrible) and in the fields itself.
When I access the script through my browser (webserver iis), the query is executed correctly and the contents of the...
I would like to have the choice in a variable_load function (as used to load variables from menu arguments) to circumvent the remainder of the page rendering process and give the user a "page not found."
I could use a drupal_goto() but I would prefer not to redirect the user and change the url in their browser.
Is this possible?
...
I run all my integers through a (int)Integer to make them safe to use in my query strings.
I also run my strings through this function code
if(!get_magic_quotes_gpc()) {
$string = mysql_real_escape_string($string);
}
$pattern = array("\\'", "\\\"", "\\\\", "\\0");
$replace = array("", "", "", "");
if(pr...
I'm in the process of setting up a php project, but am not very familiar with how to properly use php's include/require commands. My layout currently looks like this:
/public --apache points into this directory
/public/index.php
/public/blah/page.php
/utils/util1.php -- useful classes/code are stored in other directories out he...
I'm trying to make a calculator that will take inputs from users and estimate for them how much money they'll save if they use various different VoIP services.
I've set it up like this:
<form method="get" action="voip_calculator.php">
How much is your monthly phone bill?
<input name="monthlybill" type="text" value="$" size="8">
...