php

Custom comment form in CCK template

Pre-abmle: I am using MakeMeeting module to create/display meeting polls. This module has its own Content Type and I can't get comments to show on the screen (whether I choose to show comments or on same page or not in Comment Settings for this node type). The MakeMeeting module has it's own theme functions, but perhaps they're not guilt...

Need help with a regular expression in PHP

I have the following line: <?php echo $this->__("mytext");?>somesometext")moretext and I need a regular expression to grab 'mytext'. The best I could come up with is: /\$this->__\([\'"](.*)[\'"]\)/ but in this case it returns: mytext");?>somesometext Can anyone get this to work? ...

URL Rewriting In PHP MVC Framework

Hello there, I have made my own custom php framework which implements MVC design pattern. In it, all URLs are constructed like this mysite.com/index.php?route=controller/function/parameters/go/here mysite.com/index.php?route=products/shirts/99 etc I have put in place htaccess to remove index.php?route= part from URLs to make them m...

Dynamic web record

Hi, im trying to build a simple app: Six colums with these values Nr, Name, checkbox 1, checkbox 2, checkbox 3, checkbox 4. The checkboxes are project stages, Im using Mysql to store the data and retrieving it to a webpage with php. My problem is on how to go updating the checkboxes, and also how to filter the results (display onl...

Jquery - validation - Rules

Hello! I use JQ - validation plugin to validate my form. But i dont know what kind of validation rules in jquery! Could you suggest me a page where i can read about rules? I have two field, NAME and AGE, and i want it to validate for REQUIRED, MAXLENGTH, NUMBER /CHAR, MIN, MAX rules: { new_name: { required: true, maxlengt...

PHp - memory error when resizing a PNG image

Hi all, I have a script that creates a thumbnail out of an uploaded image. it works fine with jpgs, but gives me an error Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 26250000 bytes) when I upload a png image. The script is: //create thumbnail; $modwidth and height are calculated in another pa...

PHP Return content from remote page

I have for example the following URL: index.php?q=Content/Uploads/Images/1.jpg I want so that page will return the exact result of for this example: http://www.example.com/Content/Uploads/Images/1.jpg Note that if 'q' is an image so it should return an image, or if it is a web page so it should return the html and headers of the w...

mvc procedure question

Hello, I am borrowing some codeigniter authentication library and try to integrate it with my mvc version. My version initiates breadcrums in the basecontroller and every module has it's own controller that extends it. What I want to know is if I am submitting my login form, then my submit action will be /controller/function. But, I d...

Save full webpage

Hello! I've bumped into a problem while working at a project. I want to "crawl" certain websites of interest and save them as "full web page" including styles and images in order to build a mirror for them. It happened to me several times to bookmark a website in order to read it later and after few days the website was down because it ...

Need to prevent PHP regex segfault

Why does the following segfault, and how can I prevent it? <?php $str = ' <fieldset> <label for="go-to">Go to: </label> ' . str_repeat(' ', 10000) . '<input type="submit" value="Go" /> </fieldset> </form>'; preg_match_all("@ </?(?![bisa]\b)(?!em\b)[^>]*> # starting tag, must not be one of several inline tags (?:[^<]|<...

Check if a remote page exists using PHP?

In PHP, how can I determine if any remote file (accessed via HTTP) exists? ...

PHP create 3D Array from Array with 3 Values

Hi, again me: following array; $myArray = array('FOO', 'BAR', 'HELLO'); i need: $myArray['FOO']['BAR']['HELLO'] = 0; any ideas? ...

Linking to a forced download script in a pdf

I am generating dynamic PDF reports in PHP and having some issues with links to the web. My links are to a PHP script that forces the download of a file attachment. This script works perfectly in all browser when accessed via the browser. It also works from the PDF in all browser except Internet Explorer. Instead of IE seeing the fil...

Do I include session.gc_maxlifetime on every page that needs to increase session timeout?

Hello you all, Just want to know if I want to increase session time out, do I need to include ini_set("session.gc_maxlifetime", 14400); on every page I call session_start()? Thanks, L. ...

Improve HTTP GET PHP scripts

This code is getting the headers and content from $url, and prints it to the browser. It is really slow, and it's not because the server. How can I improve this? $headers = get_headers($url); foreach ($headers as $value) header($value); $fh = fopen($url, "r"); fpassthru($fh); Thanks ...

Function escaping quote is not working correctly [Solved]

Hi, (Php & MySQL) I'm trying to figure out how come this function does not work correctly. It's add extra \ everytime I edit my entries. Online server have these settings: magic_quotes_gpc On magic_quotes_runtime Off magic_quotes_sybase Off function esc($s) { if (get_magic_quotes_gpc()) { if (ini_get('magic_quotes_sy...

Call WSDL by PHP

Hi All, I need to call some webservice functions, I need my request will have format: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://SureClose.com/Services/v1" xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt; <SOAP-ENV:Header> <wsse:Sec...

Requesting email address from OpenID provider in PHP

What's the simplest way to request an email address from an OpenID provider? Is there a good PHP library that simplifies this problem? I know that providers implement things differently. I've heard you need to do both Simple Registration and Attribute Exchange. I'd particularly want to make sure that it worked with the biggest provid...

Export structure and data (like in PhpMyAdmin)

I want to export data and structure from MySQL database using PHP. I know about SELECT INTO OUTFILE command but I want to have the file like the one which is generated by PhpMyAdmin in Export window, so all the CREATE TABLE and INSERT INTO. HDo you know how PhpMyAdmn generates those files? I was browsing through the code and I've found ...

Does Nested Sets model work with article with many categories (many-to-many)?

Hi guys, I've been using the adjacency model for hierarchical data for the longest time and was searching the internet for a more efficient way to traverse trees until I read about Nested Sets yesterday. I liked the idea but have a few doubts............. Now I just wanted to know if it is possible to use the Nested Sets model for many...