php

Updating frontend layout from a module

Hi, I've created my own magento module and successfully extending core controllers and models but I'm having trouble doing the same with the layout xml files. I want to update just the checkout multishipping shipping page. So far I've only managed to to overwrite the entire checkout.xml file but I would much prefer to just have the i...

Problem with $_POST

This wont work. All the fields are correct etc and I have a db connection. To the problem I use this script to insert a post into the db: <?php if (isset($_POST['msg'])) { $title = mysql_real_escape_string($_POST['title']); $msg = mysql_real_escape_string($_POST['msg']); // kolla efter tomma fält if (empty($title) || empty($msg)) {...

PHP Problem: else condition not executing

function procLogin( $user, $pass, $remember, $hostname, $domainame ) { global $session, $form; $retval = $session->login( $user, $pass, $remember ); if ( $retval ) { if ( $session->userlevel == 9 ) if ( $session->isAdmin() ) return ( array( $session->userlevel, $session->userid ) ); } el...

how to avoid listing previously entered values in certain text fields of a form? HTML, PHP

Hi In my HTML FORMs, when I focus certain text fields they list down history of values entered previously. Is it possible to avoid this auto-drop-down? I am not looking for some browser settings tips for my computer, instead, I want these settings for all of the users of my website filling a form. Will it also be possible to apply the...

Include Scripts library into Symfony application

I have a directory of PHP scripts ( mainly utilities), that is located on C:\Development, whereas my Symfony application is located in D:\Development. How to include the utility scripts into the Symfony application? I try not to use include() because I prefer a symfony-like command. ...

pre-apend to a text file

I want to pre-append some text a a CSV file that is created by MySQL. Basically I want to add the header information for the rows so when the user opens it in Excel they know what each column is. Whats the best way to do this. I presume there is some easy linux command that can do this? I can also do it in the PHP script. I'd li...

jquery.post() and php

I'm using $().post and php to change the contents of a <textarea>. The script is succeeding - firebug clearly shows that the text in between the textarea tags has changed, and my little alert fires. The user, however, doesn't see the changes. In Firefox the change doesn't occur at all, and in IE, the textarea updates up to 10 seconds l...

need to create an application that will work on the Internet also and local internet also

hi , i need to make a website such that it can be accessed through the internet if internet is available otherwise when there is no internet then it should work properly on the local intranet also can this be achieved , i have built my site on php/mysql if this can be achieved please tell me and direct me to some examples of how to ach...

Make links clickable in PHP with twitterlibphp?

Hey guys, I'm using Twitter's PHP API, called twitterlibphp, and it works well, but there's one thing that I need to be able to initiate, which is the linking of URLs and @username replies. I already have the function for this written up correctly (it is called clickable_link($text);) and have tested it successfully. I am not too famil...

Retrieving the latest note (by timestamp) in a single query from a 1:n table

Let's say I have two tables, users and notes. Let's say the schemas look like this: users id, name, field2, field3 notes id, user_id, subject, heading, body, timestamp What I want to do is select every user, and the LATEST (just 1) note posted by each user based on the timestamp to show in an overview report. How would I go about d...

Building an array from a MySQL Query

I hope it's the heat, this is the second question today and it's one problem after the other. Relatively simple stuff... I have this query ... while ($resultV = mysql_fetch_assoc($metQueryViews)) { $allViews[] = $resultV; } The date it's getting is:- date Count NULL 6 14-5-2009 12 15-5-2009 21 26-6-2009 18 29-6-...

PHP exec pgp command

I am want to use PHP to 'exec' a pgp encryption command. Regardless of the command line I get either a err 64 (parser error) or 162 (complete failure during an encode). So I have reduced the command line within the PHP program to this simple fingerprint display which stills errs out: exec("/opt/pgp/bin/pgp --fingerprint", $results); I...

Min character length, strlen?

if (strlen($comment > 2)) { Ok, so I only want to exec this if $comment consist of more than 2 characters I believe strlen should do this, but it doesn't. Am I using it wrong? ...

can I get php to run in an asp.net page?

I'm trying to allow my php pages to run inside a content page of the master page. I'd like to run php somehow inside a master page. Besides frames is there another way? I've read you can use a frame, but would prefer not to. If I have to go with frames to get it done, should I be using an asp.net frame class of some sort or the raw html...

Instantiating child classes from parent class (PHP)

I have a class with a factory-pattern function in it: abstract class ParentObj { public function __construct(){ ... } public static function factory(){ //returns new instance } } I need children to be able to call the factory function and return an instance of the calling class: $child = Child::factory(); and prefe...

PHP MySQL Can't Insert To Text Field

Ok I have this problem that I've never had before, it's really bugging me. Basically I'm trying to submit text into a text field using a form. For some reason when I submit it with raw text and full-stops only it works fine, however it seems that when there is punctuation like a ' or a ! in the textarea then it just won't submit to the ...

PHP - URL displays fine in Chrome and IE8, but not in Firefox 3.0.11

Hello, My site prints out URLs in a table. In Chrome and IE8, the URLs look great. In Firefox 3.0.11, the URLs only display up until the second forward slash. So for example, "nytimes.com/pages/world/americas/index.html" is just "nytimes.com/pages" in Firefox. Any ideas why? The code is below. Edit: I'm beginning to think this ...

Why would cookies be vanishing in IE6/8, and what can I do about it?

I have a login setup on a site that stores login information in PHP's $_SESSION, and additionally sets a two-week cookie with login information if a checkbox is checked. The user is considered logged in if valid login information is either submitted by POST or either cookie is true. The behavior on FF3/Chrome is as intended, at least wi...

Customizing Navigation Menu in SilverStripe

I asked this question in SilverStripe forum, but haven't heard in a day. http://silverstripe.org/customising-the-cms/show/263604#post263604 I am in the process of migrating a static PHP based site + Wordpress to SilverStripe. In the static pages, we customize the header itself. We have two types of logins. Customers and Affiliates. ...

How do I include a PHP script in Python?

I have a PHP script (news-generator.php) which, when I include it, grabs a bunch of news items and prints them. Right now, I'm using Python for my website (CGI). When I was using PHP, I used something like this on the "News" page: <?php print("<h1>News and Updates</h1>"); include("news-generator.php"); print("</body>"); ?> (I cut down...