php

MySQL "an error in your SQL syntax"

Hi! I'm trying to change a database entry with PHP but is stuck with this error message: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Bjelkholm Lövgren AND adress = Brinellgatan 14 AND postnummer = 57135 ' at line 1 Code: ...

facebook like box doesn't get display in IE8 but it is getting displayed in mozilla firefox ...

hello, I am working in php ... i want to display facebook like-box using javascript sdk ... my code is as follows : in layout.php- <script > window.fbAsyncInit = function() { FB.init({appId: appId , status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('...

How long do uploaded files stay on your server?

When I use a form to upload a file, it gives me the 'name' and 'tmp_name' and you're supposed to move the file from its temporary location in order to keep it. But how long does the file stay on the server before it gets deleted? Is it stored there permanently until you manually clean up your folders, or does it get deleted once the PHP ...

PHP WebService/C# Client - Fiddler has detected a protocol violation in session. Content-Length mismatch

Please help, solving an issue between PHP WebService/C# Client. PHP WebService/C# Client - Fiddler has detected a protocol violation in session. Content-Length mismatch: Response Header claimed 292 bytes, but server sent 293 bytes. It errors on each call to the webservice due to the response size it returns. I have access to the both ...

redirect problem dont include whole querystring

I'm trying to redirect but it dont include all in the url if (!empty($_POST['nazwauzytkownika']) && $_POST['haslo']) { removed.. if (isset($_GET['redirect'])) $redirect = $_GET['redirect']; else $redirect = 'http://*****.pl/konto/?a=powitanie'; header("Location: $redirect"); } If $_GET[redirect] contains: http://localho...

How to make a "Spinner" to improve php form security?

This article about php form security: http://nedbatchelder.com/text/stopbots.html ... mentions a "spinner" as: The spinner is a hidden field used for a few things: it hashes together a number of values that prevent tampering and replays, and is used to obscure field names. The spinner is an MD5 hash of: * The timestamp, ...

Alternative Header() command to set Referer in PHP?

Hello PHP magicians! I am trying to initiate a download from a server that will give a 403 forbidden unless the referrer is set to the same domain. Currently Header() allows me to redirect the user to the file location and init a download, but referrer is always set to my script. Use of curl would cause the file to download on the serve...

PHP: list files on ftp server?

howdy, can't get it done! <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>FTP Download</title> </head> <body> <?php set_time_limit(300);//for setting $path='/userupload'; $ftp_server='202. …'; $ftp_server_port="21"; $ftp_user_name='al…';...

No POST data being returned when hidden input type is present

I think that there is either an error in my code, or my PHP or Apache is set up incorrectly. When I submit a form with a hidden field in it, I do not get any data in my $_POST array... When I comment out the hidden field in my code, the POST data is returned correctly... HTML FORM <form action='/utils/login.php ' method='POST'> <tabl...

PHP copy says file does not exist when it does

Hi, im using the following code; if( ! file_exists( $path ) ) { die( "'" . $path . "' not vaild path"); } copy( $path, ltrim($create_folder . ltrim($path, "./"), ".") ); echo "'" . $path. "' => '" . $create_folder . ltrim($path, "./") . "'<br />"; The first if statement returns true yet the copy function returns; Warning: copy('./fil...

MySQL UPDATE doesn't change anything.

I'm trying to update a database entry but it won't change anything. I'm getting no errors which confuses me... Code: if(isset($_GET['edit'])) { $idn = $_GET['id']; $namn = $_POST['namn']; $adress = $_POST['adress']; $postnummer = $_POST['postnummer']; $postort = $_POST['postort']; $email = $_POST['email']; $...

PHP function bbcode make optional to replace smileys

I want to give the oppurtunity to the user if he wants his smileys to be replaced with image smileys. I tried this. bbcode($text, TRUE); function bbcode($str, $smileys = false) { $str = htmlentities($str); $find = array( if ($smileys == true) { ':p', } '/\[b](.*?)\[\/b]/i', '/\[u](.*?)\[\/u]/i', '/\[i](.*?)\[\/i]/i', ...

How i can use a __construct function in my other CodeIgniter controller

I have a controller called member within this a construct function function __construct() { parent::Controller(); $this->is_logged_in(); } I want to check in my other controller that user is logged in how i can use this function in my other controller called profile and others This is my First project with CodeIgniter Thank ...

PHP set warnings as fatal

Is there a way to specify in php.ini or apache level that the script execution should halt on any warnings? I tried searching through google and stackoverflow but couldn't find any relevant information yet. I do know about the set_error_handler() function but I am looking to do this at the php.ini level. ...

Cannot modify header information, headers already sent.

I tried using xampp lite portable in my flash drive so that I could bring the server anywhere. But I always get an error when using xampp. This error in particular: Warning: Cannot modify header information - headers already sent by (output started at /path/to/geeklog/public_html/blabla.php:581) in /path/to/geeklog/public_html/system/li...

Setup iPhone Push Noification Server Proxy?

Since my webhosting site blocks port 2195, which is required for communication with Apple's push notification server, our app push notifications are not working. I've been looking all over for a solution: 1. Get a VPS (too expensive) 2. Use Urban Airship (push notification server) Does anyone know, or have experience, developing some s...

displaying files and DIRECTORIES via php??

hey guys, i have a propably rather simple question: I'm using the following script to read a folder? $count = 0; if ($handle = opendir(PATH)) { $retval = array(); while (false !== ($file = readdir($handle))) { $ext = pathinfo($file, PATHINFO_EXTENSION); if ($file != '.' && $file != '..' && $file != '.DS_Store...

NOW() not updating datetime?

hi there, i have a table that looks like this: Field: msg_sent_datetime Type: datetime yet when i use NOW() in a php mysql insert query it is staying as all zeros? any idea why? ...

Amazon Product API with PHP

Hi All, I'm trying to integrate Amazon Product API into my website and came across several posts that helped me construct the URL. Only problem is when I execute the code below I get the following error. Am I doing something wrong? Internal Server Error The server encountered an internal error or misconfiguration and was unable...

Zend_Date returning strange format online - works fine on my localhost

I have the following code to format dates: $date = new Zend_Date(); $date->set(strtotime($some_date); echo ($date->get(Zend_Date::DATE_FULL)); it wokrs fine on my localhost outputting the date as I need it to be outputted. However on my online server the dates are outputted in a weird numerical way. i.e the numeric value fo the Day a...