php

Is this a secure authentication system for an ajax-driven app?

I apologize ahead of time, becuase I'm neither great at explaining things nor flow charts. This is not a specific code problem, but a general question on session security. I'm trying to eliminate as many potential problems as possible at once. I think this takes care of: CSRF Session fixation Session prediction Cookie theft (through b...

Downloading from Youtube - yes, again

Welcome coders, I have question on my private server i have little script what i use for downloading Youtube videos. Today i notice that Youtube have changed something, and downloading stop working. I was extrecting download url from: $page = body (source), of page with embed video on youtube pregmatch('/&video_id=([a-zA-Z0-9-%_]...

Magento : How to check if admin is logged in within a module controller??

Hi everybody, I'm creating a Magento Module. Within the controller, I want to check if an admin is logged in or not. So the controller only will be accessible if there is a logged in admin. I'm trying to use this code on my controller. Mage::getSingleton('core/session', array('name' => 'adminhtml')); $session = Mage::getSingleton('ad...

SMF curl login issue php

Does any one have have some PHP login curl code for SMF version 1.1.11 I tried and it logs then when I check the curl output, but when the broswer loads, they are no longer logged in My code function login($data) { if(function_exists('curl_init' )) { $_SESSION['old_url'] = $_SERVER['HTTP_HOST'] .'test'; // smf nee...

'Edit' function for forum posts and such

I was looking online for a script that demonstrates how I would go about making it possible for users on my site able to edit fields and such, but I could not find anything about it. So I was wondering if someone could explain to me how it works or just demonstrate with a script? To make it clear, I want users to be able to edit stuff th...

PHP: prevent folder hacking - if path has ../ in it?

hey guys, i'm doing a simple thingy in php and i wonder how i can test if the variable $path contains the following structure ../ so i'll simply have a ?path=somepath structure in my url, and if anybody would enter ../ it allows him to go one directory up. I know of course that that's not the best solution, however for my little thingy ...

How to create a dynamic page title using PHP

Hi I was wondering if anyone can help with this PHP problem. Is it possible to use the text in a H2 tag and use that to populate the page title dynamically. I'd also like to be able to use this same technique to add the H2 text into the meta description - Can anyone help? ...

PHP: How to transport vars from php cmd (executing from shell) to PHP GET and POST Array?

Hi all, i have some scripts that need GET and POST values to start, and i wanna test them over shell. Is there some way to pass the values to that arrays to avoid using getenv() function? Thanks in advance! ...

Using appendTo() in JQuery adds element then immediately removes it...solution?

This is probably a noob question, but how I've implemented the appendTo() function below doesn't work as expected. Basically, it added the element and instantly removed it again. It's blink and you miss it stuff. Can anyone understand why this might be happening? Here's where the function gets called: <?php foreach ($words as $word) {...

php rewrite url

Hello. Is it possible to have it so when a page is requested with a get parameter from an link, say www.mtsite.com?param=val That the parameter stuff is hidden, without using post and JS? Thanks ...

CKEditor - Custom image browser

I'm currently developing a image browser in PHP and jQuery. I've managed to create a custom button plugin that opens my image browser in a new window (not a dialog box): CKEDITOR.plugins.add('imgbrowser', { init: function(editor) { var pluginName = 'imgbrowser'; editor.ui.addButton('Imgbrowser', { ...

How to reduce bytes number in SOAP response?

Hello, is there a way to reduce the number of bytes sent to the network from a SOAP response? I use nuSoap in PHP and would like to avoid xsi:type="xsd:string", xsi:type="xsd:int" in every node. Is there a way to do it? Thanks in advance c. ...

How to increase and decrease text size in web page?

What is the best way to increase and decrease text size on a web page using PHP, CSS, or JQuery? And is there any tutorials on how to do this? or an example would be helpful. Thanks ...

Change a relative URL to absolute URL

hi everyone. for example i've got a string like this: $html = ' <a href="test.html">test</a> <a href="http://mydomain.com/test.html"&gt;test&lt;/a&gt; <a href="http://otherdomain.com/test.html"&gt;test&lt;/a&gt; <a href="someothertest/otherdir/hi.html">hi</a> '; and i want to ap...

Replace the leading space with &nbsp; with same number of times using PHP regex

Hi, I want to replace leading space with &nbsp; same number of occurrences i.e. Bit explanatory : If one leading space exist in input then it should replace with one &nbsp; If two leading spaces exist in input then it should replace with two &nbsp; If n leading spaces are exist in input then it should replace with exact n number of ...

php DateTime construct crash on wamp server

Hello, I have a problem with DateTime class. I'm using xampp server: Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 and there were no problems at all, but on the other server (wamp): Apache/2.2.11 (Win32) SVN/1.6.4 DAV/2 PHP/5.3.0 web ...

foreach returns more elements than count()

Hi, I'm using Symfony 1.2.7 and Doctrine 1.1. I have $activities (sfOutputEscaperIteratorDecorator - Doctrine_Collection). I'm escaping everything on settings.yml with ESC_SPECIALCHARS method. If I weren't escaping it, it would work without any problem, so I think the problem is related with sfOutputEscaperIteratorDecorator. If I do ec...

Problem in fetching Email body content in HTML format using PHP

My code(In PHP) is fetching Email, from Inbox wihich is in HTML format, and saving it in an HTML format. while fetching some Extra characters are added to the file. Example: the content in EMAIL Body hi there 1. hi 2. hello 3. bye but when fetched i get hi there 1. =A0=A0=A0=A0 hi 2. hello 3. bye I get extra characters li...

Flash media server with php

We want to build an application that allows the user to record a video using their webcam on our site using flash and save the URL in a database using PHP. So that we can allow the user to send the video's to other users etc. Also we want to offer the user the possibility to upload their movies (per mail and with PHP) and convert them t...

Taking website screenshot, server-side, on a Linux rented server, free

Ok so, right now I can't really afford to pay for any service. I want to be able to take screenshots using my rented server, which is Linux based, and output them on the screen. I know there are a lot of services that do this, but they usually have limits or watermarks, or you have to wait for your screenshot to be taken from the queue....