After doing a bit of processing, I want to set a cookie value to user input and then redirect them to a new page. However, the cookie is not getting set. If I comment out the redirect, then the cookie is set successfully. I assume this is a header issue of some sort. What is the best workaround for this situation?
if($form_submitted...
I have a rather long php script and whenever my internet connection skips out for a second the browser seems to stop the script. I can't sit around for 8 hours for my script to run so I figured I could just run it via ssh and be come back the next day and get my output file. However simple typing the scripts name into ssh doesn't seem ...
Know any good courses, online or perhaps otherwise, you'd recommend to a relatively new PHP/MySQL web developer to get her up to speed on security vulnerabilities? It would be nice if it was fairly thorough and went beyond basic stuff like sql injection. Ideas?
Edit:
Thanks for the really great links and information, but I'm also loo...
I've had this problem for a while, and I've isolated it to being caused the mysql_connect or mysql_select_db function. For some reason, when I use jquery's .load(), the response text will have a line break at the top when displayed in the page (in a <textarea>, for instance, but in any element). Looking at the response in Firebug, there ...
If I am correct, SimpleTest will allow you to assert a PHP error is thrown. However, I can't figure out how to use it, based on the documentation. I want to assert that the object I pass into my constructor is an instance of MyOtherObject
class Object {
public function __construct(MyOtherObject $object) {
//do something with...
Is it possible using .htaccess or other apache powers to set a custom server value in the php array $_SERVER.
for example
if($_SERVER['is_special']) {
echo "Yeah for us!";
} else {
echo "No you fool!";
}
I realize I ask a lot of questions that the answer is no so feel free to say so.
...
I am working on my own website.
I am planning to have a mail function to send notification to the users who want to join my website.
The problem is the mail function of PHP does not work for me.
Can anyone help me with this?
...
I have an app that shows store sales. It is a multi-dimensional array, so each value in the root array is an array containing [sales], [cost], [date], etc. for the given day it pertains to. OK, there are 2 arrays for each store. One is for verified numbers and the next is for unverified numbers. The unverified picks up right after the ve...
Okay, So I've googled a couple of pages and come up with the following solution:
Add this in .htaccess
#Active GZIP for php-files
php_flag zlib.output_compression On
php_value zlib.output_compression_level 5
and this for .js and .css:
AddHandler application/x-httpd-php .css .js
php_value auto_prepend_file /Library/WebServer/Documen...
I think sometimes I don't need to use ELSEIF and not repeat stuff by maybe doing multiple checks inline.
I've done this before.
I'm trying this simple line and just can't make it work.
I read that:
OR is the same as ||
AND is the same as &&
Code (The short way, but doesn't work):
if($subdom<>'www' or $subdom<>'nosub')
{do some stu...
Does anyone know of a good site for beginning in YUI?
The developer's manual on Yahoo is too confusing for me.
...
Anyone know of an API (php preferable but I'd be interested in any language) for creating wiki-like data storage?
How about any resources on rolling your own plaintext wiki? How do other plaintext wikis handle the format of the text file?
I understand I can use Markdown or Textile for the formatting. But what I'm most interested in i...
When a user creates an account on my website, i want the inputted username to be checked against all the current usernames in my database(MySQL) and confirmed if it is available.
Does anyone know any good libraries i could use, or a plug-in for JQuery perhaps?
Thanks, Ben.
...
I need a function in php that will calculate the business week in a specific format within a given date range.
Example:
startDate = 02-03-2009
endDate = 31-12-2010
Mar 2-6
Mar 9-13
Mar 16-20
Mar 23-27
Mar 30 - Apr 3
Apr 6 - 10
and so on...
...
I've got a simple file host going that gives files a unique id and just stores them in a directory. I've been told that this will cause problems in the future, and I'm wondering what things I should look out for to make sure it works smoothly into the future and beyond.
Also, is there a performance issue with forcing downloads by sendin...
With forms I've always used
<form method="post" action="<?php echo strip_tags($_SERVER['REQUEST_URI']); ?>">
To get my forms to submit to themselves.
I use striptags() in case someone links to:
http://www.mysite.com/page-with-form.php?bla="><script src="http://www.nasty.com/super-nasty.js"></script><a href="#
Hav...
I've tried to research this mechanism but only find hints and these are not very consistent. How is the session _id sent to the browser and how is the browser instructed to return it when the user requests a new page?
Thanks, Chris
...
I want to display a menu on every page that is run from a database. Using just down and dirty php thats easy but I want to integrate it with cakephp using their MVC system.
Now my question is how is the best way to go about this?
My thoughts are to make an element with the layout and then a component or controller for all the logic. ...
OK I have a mySQL Database that looks something like this
ID - an int and the unique ID of the recorded
Title - The name of the item
Description - The items description
I want to search both title and description of key words, currently I'm using.
SELECT * From ‘item’ where title LIKE %key%
And this works and as there’s not much in...
I am trying to execute my php code, which calls two mysql queries via mysqli, and get the titular error.
Here is the code I am using
<?php
$con = mysqli_connect("localhost", "user", "password", "db");
if (!$con) {
echo "Can't connect to MySQL Server. Errorcode: %s\n". mysqli_connect_error();
exit;
}
$con->query("SET NAMES 'utf8...