Is there a good method of form security that does not involve CAPTCHA? CAPTCHA is so annoying, but I need security because I am getting form spam. My form is PHP.
visitors from either of 3 countries New Zealand, Fiji or India, need a different content page respectively. site is php, content is in html files ready to be included.... im a newb please be patient!!
Hi.
Tumblr and other blogging websites allows people to post embeded codes of videos from youtube and all video networks.
but how they filter only the flash object code and remove any other html or scripts? and even they have an automated code that informes you this is not a valid video code.
Is this done with REGEX expressions? And Is there a PHP code to do that?
Thanks
I've been trying to configure xdebug to work along with netbeans, my current configuration is
[xdebug]
zend_extension="C:\binaries\php\ext\php_xdebug-2.1.0RC1-5.3-vc6.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1 (also tried localhost)
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
I tried the test provided by a netbeans blog explaining how to test if the configuration works when binding it just outputs "unable to bind"
Any suggestions?
Hai
Thanks for everything. I have successfully implemented clean URL in local. Very nice site.
Now my objective is to create a clean URL web site in PHP Microsoft IIS 5.0, I know this in Apache. But I don't know how this on IIS. Does any one give me a solution?
Hi all,
I'm trying to rewrite some query strings I have in my URL like this :
foo.com/index.php?page=admin&view=news&action=edit&id=3
to
foo.com/admin/news/edit/3
But can't figure it out...
it should also works if I only have the 'page' parameters for example, since I don't always have these 4 parameters (page,view,action,id) in my urls, of course.
any suggestions?
I am trying to run a script on my local machine, I am on MAC OSX leopard. I have PHP 5.2.x installed and Apache2. I am trying to test this script but I keep getting this error. I googled around a little and saw something where it said it might only be available on linux/unix machines but I find that hard to believe.
Ok, I'm about 50% done with the "30 minute" quickstart guide from Zend.
I must be missing something, because this seems like a total waste of time. The point of this quickguide is to create a guestbook, something I could do in 5 minutes with regular naked non-framework php.
Here's my path to zend framework:
c:/program files/wamp/www/_zend/
Here's my path to my quickstart project:
c:/program files/wamp/www/_zend/bin/quickstart/
I have a number of questions at this point:
http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
1: I'm running the command line to run my database loading script. I get an error stating the it can't find the Zend/AutoLoader.php becuase my path to the zend library is wrong. I followed all of the steps. I defined the path to my zend library in the main config file, but for some reason, its defined again in my db loader. In all of these scripts that they have me load, it points the relative path to the zend library as being /../library
Problem is, there's nothing in that folder. To get to my actual zend folder, you'd need to be (relatively) /../../../../library
Which brings me to my 2nd question:
2: Where the #$#$ is the main Zend files supposed to be? The install directions were basically "put it wherever you want", when the real answer (after a bunch of errors and wasted time was) was "put it somewhere so that its really easy to type the full path a thousand times in command line" and "it also better be in a runnable place on your webserver since its going to create your quickstart application in a subdirectory within zend".
Which brings us to the third question
3: Am I supposed to have this libary in both the parent core Zend (wamp/_zend/library) AND my application (quickstart/library)?
4: If that is the case, it seems like a ton of wasted files to be uploading. I'd like to use Zend to create products that my customers will download. 5 megs of overhead seems like a bit much. Zend claims you can use these library components separately, but it looks to me like I'm going to have to upload them every time.
Which leads to the next question:
5: It appears that perhaps Zend is more for a single application that is not supposed to be distributed. Is this not the case?
6: According to their default file structure everything but my /public folder would be above public_html on my server if I wanted this to rest on my TLD. I would need to rename every reference of /public/ to /public_html/, or am I missing something else?
I try to send http request like:
..."POST http://api.facebook.com/restserver.php?method=facebook.users.setStatus&api_key=762ec91e7987aaeaee7e2cdfdfcb3c30&call_id=$call_id&sig=$s&v=1.0&uid=1533439618&status=44 HTTP/1.1";....
but I receive nothing...
in twitter I success:
..
"POST ht tp://twitter.com/statuses/update.xml?status=123123 HTTP/1.1"
...
Hello,
I am trying to create my own torrent tracker but dont know how to generate info_hash that is used xbtt to track torrents.
Is this possible with php?
I am using this function to bencode and decode http://paste.lisp.org/display/17178
Thank You.
Is Magento usually so terrible slow?
This is my first experience with it and the admin panel simply takes ages to load and save changes. It is a default installation with the test data.
The server it is hosted on serves other non-Magento sites super fast. What is it about the PHP code that Magento uses that makes it so slow, and what can be done to fix it?
Hello,
I'm kind of a website development nub so bear with me.
My problem is that the website php session doesn't seem to be set when I log in to my website. After ensuring that the username and password are correct, I have the following simple code:
$_SESSION['username'] = $myusername;
$_SESSION['password'] = $mypassword;
session_start();
Content that should display after logging in is not displayed.
Thanks in advance,
Matt
I'm using the David Walsh PHP calendar script and need to format my date arguments like this:
draw_calendar(7,2009);
I want to get today's Month and Year as well as the next month and the month after that (so current month, plus one, plus one). How can I call the function three times in succession to generate these three calendars only knowing today's Month and Year?
-Brandon
I want to Zend_Auth and Zend_Session to save user sessions and logins information
whats the easy and best way for implements following items:
1-Disallow multiple concurrent logins for the specific user
2-List all of all user currently logged in
3-Admin could logout of specific user or destroy specific session
Is there any special ZF or PHP API or library that can do the above?
thanks
Hi,
I am (newbie) using Kohana V 3.0.3 and my directory structure is:
pojectsys (kohana's system directory) parallel to htdocs directory
C:\xampp\pojectsys
and my application directory is in htdocs
C:\xampp\htdocs\examples
Inside C:\xampp\htdocs\examples\index.php, following variables have been set:
$application = 'C:\xampp\htdocs\examples\application';
$system = 'C:\xampp\pojectsys';
Now when I am trying to execute http://lc.examples.com/ then Kohana returns error:
ErrorException [ Fatal Error ]: Class 'Controller' not found for line 3
class Controller_Welcome extends Controller {
Please help me to resolve this issue.
Trying a bit of AJAX, and I find that much of my data is littered with underscores!
Documentation confirms that this is working as intended. Any way to pass my form information to PHP intact? I'm using CodeIgniter, so my pass looks like /controller/function/variable,
receiving controller:
controller{
function($v=0){#what once was hello world is now hello_world...}
}
I can't very well do an undo, data might contain an underscore.
Thanks,
Brandon
good morning programers,
I have this small code which content a news control panel and I made a submit button there to active or inactive the news row so if I click on this button it should change if it's active it will be inactive it worked but there's something wrong there when I click on item one it updates the last on the table not the first on as it should do.
here is the code that I use
<?php
$getNewsData="select * from news";
$QgetNewsData=$db->query($getNewsData)or die($db->error);
$count=mysqli_num_rows($QgetNewsData);
while($newsRow = mysqli_fetch_array($QgetNewsData)) {
$getActivityStatus=$newsRow['news_activity'];
switch($getActivityStatus){
case 1: echo"<input style='color:red; font-weight:bold; background:none; border:0;' name='inactive' type='submit' value='?????' /><input name='inActive' type='hidden' value='".$newsRow['news_id']."'/>";
break;
case 0: echo"<input style='color:green; font-weight:bold; background:none; border:0;' name='active' type='submit' value='?????' /><input name='Active' type='hidden' value='".$newsRow['news_id']."'/>"; break;}
}
if(isset($_POST['inactive'])){
$inActive=$_POST['inActive'];
echo $inActive;
$updateStatus="UPDATE news SET news_activity=0 WHERE news_id='".$inActive."' ";
$QupdateStatus=$db->query($updateStatus)or die($db->error);
if($QupdateStatus){
}
}
if(isset($_POST['active'])){
$Active=$_POST['Active'];
echo $Active;
$updateStatus="UPDATE news SET news_activity=1 WHERE news_id='".$Active."' ";
$QupdateStatus=$db->query($updateStatus)or die($db->error);
if($QupdateStatus){
header("Location:CpanelHome.php?id=7");
}
}
?>
please any idea to solve this problem.
Thanks,
regards
I'm using PHP and I've never really done anything with Javascript or JQuery or AJAX. I'm just wondering if there are any available solutions to accomplish the same effect of auto-completion that SO uses for entering tags.
There are plugins which can handle one word but I haven't seen any that handles multiple words.
Also, I hear JQuery is hosted on google code. Is it a good or bad idea to link directly from that?
Is it possible to read cookie expiration time with php ?
When I print_r($_COOKIE) it outputs:
Array
(
[PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f
[userId] => 1232
[userEmail] => [email protected]
[firstName] => user
[lastName] => user
)
So I think $_COOKIE don't have the expiration time, is it possible with some other function?
Im using the Twitter API to read the Favorites RSS, it generates the following output:
http://vl3.co.uk/favs/getfavs.php
I'm not sure why this file seems to be incorrect, doesnt come up in my RSS reader or render correctly in the browser. Can anyone shed any light on this?
If the output is not valid RSS how can I make it so?
Secondly I'd like to cache the RSS feed to then use something like Magpie RSS Parser.
Hi, I'd like to print a simple table in my page with 3 columns, building name, tags and architecture style. If I try to retrieve the list of building names and arch. styles there is no problem:
SELECT buildings.name, arch_styles.style_name
FROM buildings
INNER JOIN buildings_arch_styles
ON buildings.id = buildings_arch_styles.building_id
INNER JOIN arch_styles
ON arch_styles.id = buildings_arch_styles.arch_style_id
LIMIT 0, 10
My problem starts on retreaving the first 5 tags for every building of the query I've just wrote.
SELECT DISTINCT name
FROM tags
INNER JOIN buildings_tags
ON buildings_tags.tag_id = tags.id
AND buildings_tags.building_id = 123
LIMIT 0, 5
The query itself works perfectly, but not where I thought to use it:
<?php
// pdo connection allready active, i'm using mysql
$pdo_conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
$sql = "SELECT buildings.name, buildings.id, arch_styles.style_name
FROM buildings
INNER JOIN buildings_arch_styles
ON buildings.id = buildings_arch_styles.building_id
INNER JOIN arch_styles
ON arch_styles.id = buildings_arch_styles.arch_style_id
LIMIT 0, 10";
$buildings_stmt = $pdo_conn->prepare ($sql);
$buildings_stmt->execute ();
$buildings = $buildings_stmt->fetchAll (PDO::FETCH_ASSOC);
$sql = "SELECT DISTINCT name
FROM tags
INNER JOIN buildings_tags
ON buildings_tags.tag_id = tags.id
AND buildings_tags.building_id = :building_id
LIMIT 0, 5";
$tags_stmt = $pdo_conn->prepare ($sql);
$html = "<table>"; // i'll use it to print my table
foreach ($buildings as $building) {
$name = $building["name"];
$style = $building["style_name"];
$id = $building["id"];
$tags_stmt->bindParam (":building_id", $id, PDO::PARAM_INT);
$tags_stmt->execute (); // the problem is HERE
$tags = $tags_stmt->fetchAll (PDO::FETCH_ASSOC);
$html .= "... $name ... $style";
foreach ($tags as $current_tag) {
$tag = $current_tag["name"];
$html .= "... $tag ..."; // let's suppose this is an area of the table where I print the first 5 tags per building
}
}
$html .= "...</table>";
print $html;
I'm not experienced on queries, so i though something like this, but it throws the error:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
What can I do to avoid this? Should I change all and search a different way to get this kind of queries?
I have a facebook app that is displaying random quotes - it is written in php.
One quote in the database looks like this:
"There's only one rule in photography - never develop colour film in chicken noodle soup.
- Freeman Patterson"
When it is seen on facebook it looks like this:
"Thereu0027s only one rule in photography - never develop colour film in chicken noodle soup.
- Freeman Patterson"
How do I fix it?
I have a PHP web application that I want to make accessible across multiple clients. So, I'm trying to make it more like an API. My question is: How would I handle the creation of new users using the API? If I have a URL like http://example.com/user/signup which takes new user details and creates a new user via a POST request, wouldn't it be a problem that people can misuse it and create fake users easily?
I have my input placed into mySQL through a PDO prepared statement, and have it placed in my website with PHP using htmlspecialchars() to protect against XSS. Only problem is now I get slashes, before any quotes, that are visible on the webpage to the user it only happens when I upload it to the server. Never happens on my localhost.
Why is this happening?