php

scrape & regex match doesn't work

Ok, I have page with something like this (I added 'scrapehere' string to make it easier to navigate, this page isn't 100% correct html and it has two identical fields with different values. No, I can't fix it because it's cms i'm using and i feel it would be too complicated for me to do): scrapehere<input type="hidden" id="_someid" name...

How can I send an array of javascript object to a php script via $.post?

I have a table of data on my page. The columns are "start", "end", "comment", and "options". Within the options column is a button to delete the row, and a button that makes a row of the table editable. This allows the values of "start", "end", and "comment" to be changed. Clicking it again finishes the editing process. Finally, there is...

how to escape < sign in php regex

Should i add some character/s before or after < character (which is in string i'm trying to extract something from - it's html page) when doing preg match? ...

Loading a secure file with cURL

I'm trying to use cURL to access a secure file.. The documentation for its use is confusing so I searched and found two sites (1 & 2) and a reference here on SO but the scripts don't seem to work for me. The site I'm am trying to access has the data I need publicly available, so I don't need to log in or provide a password. This is the...

jQuery appendTo(), json not working in IE 6,7,8

I've been racking my head for two days trying to find a solution for this. I'm using jQuery.ajax() to grab values from the database to update a box when another box is changed. The php script grabs the values from the database and then spits out json. IT works fine in FF but in all versions of IE the select box doesn't get updated. I'v...

How should I split MVC models in my PHP app?

I have a PHP site based on a simple MVC principle. I currently have one model file with many functions for getting data from the database. However, it's becoming a little monolithic now so I'd like to split it into separate models. The question is - what's the best way to do this? Is it a good idea to create a class for each table, so I...

Forming URL from string and variables

Hi, I am working on a PHP script that automatically displays an image based on certain elements (which don't matter for the sake of the question since that part works perfectly fine.) Out of the browsers I have tested it in, the images are correctly displayed on Google Chrome, Internet Explorer, and Safari. However, they do not appear...

MVC: how to ajax?

I'm going to start a project using a Zend Framework MVC implementation. How do I work with ajax? I mean, should I place all ajax code into controller? Or into view? For example, I want to get posts from author 'ivan' to show on a page. Normally, I create a link to '/posts/author/ivan' or smth like it, create a new Action like 'byAutho...

Passing constantly changing query strings PHP

I have a list of articles on my page, and I would like to be able to apply a myriad of sorts and filters to it by appending $_GET values to the URL: http://www.example.com/blogs.php?sort=newest&amp;popularity=high&amp;length=200 If I have links on my page to append these values to the url...they need to be smart enough to account for a...

Reading Website pages

Hi, my question is as follows: assume there is a website called website.com/a the website is being developed using PHP, Perl, Ruby and other languages. i want to be able from my website to read this website pages, execute the code and then analyse the HTML result page tags and getting the content using PHP. it's like reading news f...

php gd: when i crop images through php some images come out smushed.

hi, here is the website im talking about http://makeupbyarpi.com/portfolio.php you'll notice some of the images are smushed width-wise. the code i used is this: $width="500"; $height="636"; $img_src = $_FILES['galleryimg']['tmp_name']; $thumb = "../gallery/".rand(0,100000).".jpg"; //Create image stream $image = imagecreatefr...

PHP and MSSQL - LARGE text field retrieval

Here's my deal: I've got a site running PHP 5 (5.2.5 specifically) on a windows server, that's talking to a MSSQL 2005 database for it's data. I'm accessing the database using the latest version of the ADODB framework. I have a table with a unique id and a text field. This all works well and good until the text field reaches a certain si...

How to programmatically get SVN revision number?

Like this question, but without the need to actually query the SVN server. This is a web-based project, so I figure I'll just use the repository as the public view (unless someone can advise me why this is a bad idea). I assume this info is in a file in the .svn folder somewhere, but where, and how do I parse it? I want to do something l...

php file not able to upload in .net application, permission issue

Hi, I have a php file in a folder C:\Myfolder and all files are here (html,aspx). When i type the application url\index.html page works fine bt if i give index.php its saying page not found. My php file only contains "hi" message right now. I guess IIS server is not recognizing the php files. ...

Can you store a function in a PHP array?

e.g.: $functions = array( 'function1' => function($echo) { echo $echo; } ); Is this possible? What's the best alternative? ...

Wrapping a chunk of text with tags using PHP

I'm trying to allow a user (using Wordpress) to insert a jquery slideshow gallery (http://www.queness.com/resources/html/slideshow/jquery-slideshow.html) based on a faux tag. For example: [slideshow] <img src="url" /><br /> <img src="url" /> [!slideshow] Would produce something similar to <div id="gallery"> <a href="#"><...

Jquery Add Values to Select Options

i have google this option many days but i did't find it. what i want is: I have two Select BOX First Select box Have Country Names Second Select Box is Empty what i want is when i select any country (i.e United Kingdom) from first select box, a php query should run to get all cities name from table then add them to second select bo...

How to manipulate trac (web-based software project management application) data from external source/web application?

I was planning to implement a way to extract/update/insert trac's project related data from different web application. Assuming I have direct access to database (eg. MySQL, because maybe SQLite will not work if the external site does not have access to the file system). Is there any API for trac that I can use to manipulate milestone & ...

How can I include PHP in a vBulletin style?

I'd like to use PHP in a vBulletin style/skin, yet when I do so, the PHP doesn't work. By 'not work', I mean it's treated just as plain text. And if you look in the code you can see the PHP code (hidden, by Firefox - which is the behaviour you get if you put PHP code on a plain html page) http://vapurl.com/h0kp3fqr8c - view source, and...

PHP using too much memory

I'm getting the following error when trying to run a php script I wrote: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 56320 bytes) in /home/evergrf2/public_html/ianburris/p/maptile/mapfetcher.php on line 43 What confuses me is that it says the allowed memory size is 33554432 bytes and that...