php

What are some good web development blogs?

I'm just getting into some basic web development (just a personal homepage for now, but I have plans for bigger things once I know the basics). I find that blogs can be quite helpful in getting into the mindset of a particular activity, so I was wondering if anyone knew some good ones. I'm particularly looking for education blogs i.e. on...

How to use Code Igniter to show Dynamic images via javascript(jQuery).

You can use the URL helper in Code Igniter to load CSS and Javascript with the base_url() method, but what if you have images dynamically being placed into your HTML via javascript? for example in my javascript file I've got var arrowimages={down:['downarrowclass', 'images/down.png', 23], right:['rightarrowclass', 'images/right.png']} ...

PHP: documentElement->childNodes warning

$xml = file_get_contents(example.com); $dom = new DomDocument(); $dom->loadXML($xml); $items = $dom->documentElement; foreach($items->childNodes as $item) { $childs = $item->childNodes; foreach($childs as $i) { echo $i->nodeValue . "<br />"; } } Now I get this warning in every 2nd foreach: Warning: Invalid argument supplied f...

PHP file copy to another server; Access filesystem on other server

I'm trying to write a PHP script to copy the files from your local machine to a server: $destination_directory = 'I:\path\to\file\' . $theme_number; if(!@opendir($desination_directory)) { echo 'Sorry, the destination directory could not be found.'; die(); } I check the access to the destination folder with that process, and I ke...

whats wrong with this php mysql_real_escape_string

Hi Atomic Number Latin English Abbreviation * check the variables for content */ /*** a list of filters ***/ $filters = array( 'searchtext' => array( 'filter' => FILTER_CALLBACK, 'options' => 'mysql_real_escape_string'), 'fieldname' => array( 'filter' => FILTER_CALLBACK, 'options' => 'mysql_real_escape_string') ); /*** esc...

How to check what goes wrong in $view->render with Zend Framework?

Hi, I'm working on a CMS with Widgets. On my localhost the followong code works perfect, but I have no idea what I'm doing wrong ... The neede files exist, I think and I get no error message. As far as I can see, the error occurs in the one before last line of code and I get no error message. $view = new Zend_View(); $view->setScriptPa...

Assigning const value to const error in php

<?php class Lala { const a = "a"; const b = a . "b"; } ?> Parse error: syntax error, unexpected '(', expecting ',' or ';' on line 4 What's the problem with it? ...

How do i sort by: most viewed, most commented, most popular, best rating, etc?

Pretty basic question.. I kno.., I just don't know how its done. I see it everywhere. I want to be able to sort out my content in my websites by most viewed, most commented, most popular, best rating, etc...with a drop down list, check box, etc... but I don't know how "sort by" works? Which scripting language should it be written in? Ja...

Wordpress plugin - add a new page

Starting out with Wordpress plugin development - how does a plugin add a page to Wordpress that utilizes the current theme? For instance the plugin would create a page at this URL: http://wordpress/plugin-name/start This page should display a form using that utilizes the current theme. At the end of the day I'm going to replace the cur...

Create unordered list tree menu from data stored in an table with the adjacency list model...php

I need to create a tree menu of "nth" subcategories. I settled on using the adjacency list model for my table structure, because I won't be updating this table very much and this seemed the easiest to implement for my use. I want to style the output using "ul" and "li" tags...I already have a css and jquery solution to do the styling...

php/mysql append state to city

Hello, Having a hard time figuring out the best way to do this... I have a search function that takes "search terms" and "search location". In the location input, I have an suggestion feature that brings up "city, state abbreviation" but it seems some users just do not use it(or can't) so they end up entering just a city name... I need...

PHP errors -> Warning: mysqli_stmt::execute(): Couldn't fetch mysqli_stmt | Warning: mysqli_stmt::close()

I keep getting this error while trying to modify some tables. Here's my code: /** <- line 320 * * @param array $guests_array * @param array $tickets_array * @param integer $seat_count * @param integer $order_count * @param integer $guest_count */ private function book_guests($guests_array, $tickets_array, &$seat_count, ...

Why doesn't eAccelerator cache to harddrive?

Hi! When looking at the set folder in php.ini for eAccelerator to use, nothing is there. No hidden files as well. Directory is writable as well: eaccelerator.cache_dir = "c:/wamp/tmp/eaccelerator"' Also got the following settings in php.ini to allow disc cache: eaccelerator.disk_size="12" eaccelerator.keys="disk_only" eaccelerator.s...

How to display query results in an HTML page

When showing data from a mysql table on an php page does it have to be in a table?? What I want to do is display my results in divs. like so: <div class="moviebox rounded"><a href=""> <img src=" $imgurl " /> <form method="get" action=""> <input type="text" name="link" class="link" style="display:none" value="http://us.imdb....

PHP GD Text Transparency..

Hello, I can't slove this. I'm trying to make a text transparency but doesn't work.. Here how it looks: qshort.com/userbar/gd.php Here how if possible to show with transparency: qshort.com/userbar/transparent.png Is that possible? Here my PHP Code: <?php header('Content-type: image/png'); $im = imagecreatefrompng("signature.png"...

get_object_vars() vs. cast to array

Are there any differences between get_object_vars($obj) and (array) $obj ? Both seem to return the public properties of the object. Which is better? ...

Time Zones for different users

I am creating a script that allows the user to choose their own timezone... If I am to make this work, how do I store dates in the database so that every timezone will read it, and show the correct date in their timezone? Do I store the date as GMT and then when a user with the timezone GMT +10 selected views the item within my script,...

Get data from database without refresh whole page

Hello everybody. My project is about a school admin I have a page called : createClass.php, where user inserts grade, profile etc. When he press "submit" page called createdClass.php is loading. Inside this page I have all code which insert data into database and also an "if" structure which says : "Class already exists" if in database i...

best php method of getting images from a url and saving?

I want to allow users to put in am img url instead of uploading an image, the image would then go through my thumbnailing class. Is file_put_contents the best method? ...

Need advice on cron job'ing a very large process

I have a PHP script that grabs data from an external service and saves data to my database. I need this script to run once every minute for every user in the system (of which I expect to be thousands). My question is, what's the most efficient way to run this per user, per minute? At first I thought I would have a function that grabs all...