|
-
The Zend Framework is out!
Date: 03/04/06
Keywords: php, web
Weee! Zend released a preview version of their PHP framework: http://framework.zend.com/download
Basically it's Zend's effort to stop PHP developers from reinventing the wheel for every new application they start. There's a little bit of Ruby-on-Rails-like functionality, with the Zend_Controller and Zend_View classes, and other neat classes to help with Ajax, Web Services, PDFs, input filtering, etc. It's designed to play nice with your existing classes, letting you include what you need and leave out the rest.
I haven't tried working with it yet because there's a lot of info to absorb but the code looks pretty solid. Anyone try it out for real yet?
Source: http://community.livejournal.com/php/421494.html
-
Chinese Issues with unicode
Date: 03/02/06
Keywords: no keywords
I have a script where the input form is used in China. Had a situation that rose up today where a chinese symbol somehow truncated the "<" of . This of course resulted in a big mess when the form was recalled (same form) from an administrative side.
Apparently, PHP and MySQL are set up on this server to deal with these characters in UTF8-Unicode. When the data is inserted in MySQL and I pull it up via say PHPmyAdmin, the jarbled characters have obviously been encoded because when the data is recalled, I get chinese in the form.
So, I guess the question is what is the best way to approach this problem? I tried utf8_encode and utf8_decode. Because MySQL is already set up with encoding these characters, I get ??? or nothing at all when the data is recalled. Obviously, I don't want characters to just dissapear through a filter, so what do you do? What function am I looking for?
Source: http://community.livejournal.com/php/421138.html
-
Uploading/Emailing Files
Date: 03/01/06
Keywords: mysql, database, sql
Hey all,
I'm trying to build a form that submits its contents to a database, with the exception of two file fields that are supposed to be emailed to someone. I can get the form working fine as usual, but for whatever reason, the file emailing section is not working. It acts like the files don't exist. Any suggestions? Also, I can't upload these files to my server because my admins are nazis - is there any way I can store a word doc or pdf in a mySQL db?
Thanks!
Source: http://community.livejournal.com/php/421008.html
-
FileMaker
Date: 03/01/06
Keywords: software, database, asp, jsp, web, microsoft
Has anyone here ever used FileMaker Pro (http://www.filemaker.com/)? I have one client who is starting up a Pilates studio and she's looking at http://www.pilatessoftware.com for her internal management. She would also like to have the website interact with it (ie. have members log in and register for classes, etc.) It seems that the network ready version of the Get Physical (pilatessoftware.com) uses FileMaker as it's underlying database. The FileMaker site has the following:
ODBC/JDBC source Exchange data with other applications via the ODBC/JDBC source support in FileMaker Server 8 Advanced. For example, you can replicate FileMaker information to other database products, use other reporting tools with FileMaker data, or build JSP or ASP websites based on FileMaker data, using popular tools such as Lasso Studio, Dreamweaver MX 2004, Adobe GoLive CS, and Microsoft FrontPage.
So it seems that I can get the info from the program but does anyone know if I'd be able to send info back to it? or is it a one-way channel?
x-posted to webdesign, webdev
Source: http://community.livejournal.com/php/420815.html
-
Class or Hash?
Date: 02/26/06
Keywords: no keywords
Not going to do a poll, but I am curious: which do you prefer using, classes or hashes?
I was working on a class tonight that needed a specific set of data passed to a funtion. My first impulse, after playing with VB.NET for the past few months, was to create a class. However, during the debug process I switched to a hash to test something. I'm probably going to stick with the hash, as it's just as easy and requires less code.
In general, though, what does everyone prefer?
Source: http://community.livejournal.com/php/418897.html
-
MySQL/PHP connection error
Date: 02/26/06
Keywords: cms, php, mysql, database, sql, hosting
I programmed a CMS for one of my client and put it up on my own site in a test directory while it was in development. It was working just fine. They finally got their own hosting set up with Network Solutions so I uploaded all my files, set up the database and changed the username, password and db name in my scripts. Now I'm getting the following error: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
I've double checked that I have the right username and the right password.
I'm using the following code to connect: $link = mysql_connect('localhost', $user, $pass) or die("Could not connect : " . mysql_error());
When I log into phpMyAdmin I see the following: MySQL 4.1.16-log running on localhost as eclipse@localhost so I'm assuming that 'localhost' is right. What else could be wrong? I've tried emailing tech support at Network Solutions but I doubt anyone there will get back to me. It's a pretty basic error but i can't figure out what else I would've needed to change when switching the site from my server to theirs.
Source: http://community.livejournal.com/php/418712.html
-
ughh.
Date: 02/25/06
Keywords: php, web
I'm trying to install Zen Cart on my site, which is hosted by Go Daddy. Everything was going fine until I got to the installer, but then came the problem. It says "PHP Session Support is required. You need to enable PHP Session support on your webserver. You might try installing this module: php4-session"
I know nothing about PHP and have tried to find info about this for over an hour, but nothing makes sense to me. You will be a life saver if you can help me. Thanks in advance!
Source: http://community.livejournal.com/php/418502.html
-
Not really PHP
Date: 02/24/06
Keywords: php, web, google
This is not really PHP related but I know you're all smart and someone will be able to help. :) It's to do with .htaccess and rewrite rules and stuff..
I've got a website with a page structure like this: /page.php?p=page_name_here
I want the urls to be this: /page/page_name_here
It has a category structure like this: /cat.php?c=1
I want the urls to be this: /category/1
A friend suggested:
RewriteEngine on RewriteRule ^page/([A-z0-9-_]*)/$ page.php?p=$1 [QSA,L] RewriteRule ^category/([0-9]*)/?$ cat.php?c=$1 [QSA,L] ..but it's just giving me Internal Server Errors. Any suggestions? I've googled like mad but can't see what's wrong.
Resolved. Used this:
RewriteEngine on RewriteRule ^page/(.*)$ page.php?p=$1 [QSA,L] RewriteRule ^category/(.*)$ cat.php?c=$1 [QSA,L]
Source: http://community.livejournal.com/php/418277.html
-
PHP + GD
Date: 02/24/06
Keywords: no keywords
Im having a problem trying to display a PNG image what im trying to do is have a background image, with certain width, being transparent, everything seems to work except two things...
whenever I try to load an image with creeateimagefromjpeg, it gives me errors saying that 'filename is not a valid jpeg image. but when i display createimagefromgif, for gif images, they show, but not all of them
I have an array of filenames of gifs & jpegs that loops through, and uses imagecopymerge, and it only shows the first image of every row (say theres three rows of images being placed onto the big transparent background image) I have a copy of the code Im using here... http://pastebin.com/569875 and sometimes, the text being displayed to seems to change after three of four text placements
Also, I have another script here http://pastebin.com/569881 that is creating imagecreatefromjpeg but just one time, not through a Loop
someone please help me fix this, been at this for days, and I need this for work!!!
Thanks..
Source: http://community.livejournal.com/php/418002.html
-
A simple, customizable frontend script for a database?
Date: 02/23/06
Keywords: database, web
Hi, I have such a simple question- What is a simple, customizable frontend script that I can use for a website I'm building at work?
We are a health access organization, and our website features a provider database. Unfortunately, I can't find a good script that does what I need. DaDaBik is EXACTLY what I want, but the server the site is on does not have magic_quotes enabled, so it won't work.
Basically, I need to be able to:
- search - add records - customize it completely to blend in with the site
Any help or ideas you have would be great! Thanks in advance!
Source: http://community.livejournal.com/php/417786.html
-
PHP/MySQL Developer job posting
Date: 02/22/06
Keywords: php, mysql, rss, css, html, database, sql, java, web, linux, apache
I hope job postings are welcome here.
We are looking to hire a PHP/MySQL Applications Developer at our offices in Charlestown, MA (part of Boston). This is a full-time, on-site position. If you are interested in applying, please send your resume, links to successful projects, and a code sample (100 or more lines showing your coding abilities and standards) to mo at smarterliving dot com.
PHP/MySQL Applications Developer
We are looking for a smart, creative, motivated self-starter who wants to join a strong team of developers in a rapidly growing company, building some of the leading consumer websites in the travel industry.
The PHP/MySQL Applications Developer will be a part of our Applications Development team developing scalable, database-driven web applications for our production websites (www.smartertravel.com and www.bookingbuddy.com) in a LAMP (Linux, Apache, MySQL, PHP) environment.
We offer competitive salary & benefits and a great work environment in T-accessible office space with parking on the Charlestown/Somerville line.
Job Qualifications:
The ideal candidate has 2-5 years experience developing with PHP 4-5 in a professional team environment using Object-Oriented Design principles. A strong understanding of XHTML, CSS, MySQL and JavaScript is also required. Experience with AJAX, JSON, RSS or other emerging technologies is a plus.
The successful candidate will communicate well, be committed to delivering quality work on an aggressive schedule, and must be able to function independently as well as part of a team. Must document code faithfully and take good coding practices seriously.
To apply:
To apply please provide a resume and cover letter including links to successful projects and summarize your participation. A code sample sufficiently long to show coding style and design methodology is also required. In addition, please indicate the best time to contact you, between the hours of 9:00 a.m. and 6:30 p.m., Monday through Friday.
IMPORTANT: Any submission not including code samples and links to working online applications that the candidate has written will be ignored.
The location for this position is in Charlestown, MA. It is a full-time, on-site position.
X-posted.
Source: http://community.livejournal.com/php/417360.html
-
HWCompany v11.1.7
Date: 02/22/06
Keywords: templates, mysql, database, sql
New additions to the languages, support and templates... and changes in the database, sessions and parser...
Changes: Database:
Languages:
- added small-script codes for more language strings in site
- updated the german descriptions
Parser:
- added small-script parser for the language strings
Sessions:
- added cookies to remember skin, language and login
- added failsafe sessions
Templates:
- removed strings now in the small-script
- overviewed and cleared of errors
I hope this version will be even better as progress continues to move on... I really love working on this site... it teaches me much...
In the future, I' m gonna move to another server, with MySQL... but I still have to see what that contains... If they use a contract, things can get out of hand, so I have to watch out... I already have my wishes written down for them... so we' ll see...
If you want to test the site, I' ve got the links here:
There you go, enjoy your visit!
As far as the script for the winamp controller, I have no idea why it doesn' t work on the computers at "work"... It seems like they have a secure network, but then the IT guy tells me it' s not secured... it makes me go blah! lol
I' ll try find a way around, because I' m just me, and I have to get through this...
Kash
PS: You may think I' m crazy, right? WELL DAMN RIGHT YOU ARE! LOL
Source: http://community.livejournal.com/php/417088.html
-
editing php.ini using .htaccess
Date: 02/21/06
Keywords: php
can this be done? I need to change the upload_max_filesize to 2.5M I tried creating an .htaccess file with the line:
upload_max_filesize = 2.5M;
but it didn't work. any suggestions? here are the phpinfo() settings
Source: http://community.livejournal.com/php/416918.html
-
[FIXED]working with images
Date: 02/21/06
Keywords: no keywords
i've never had to work with images before, so this is my first time and i'm quite enjoying it, however i seem to be getting black images as opposed to resized version of the files i input, what am i doing wrong?
class upload_utility { var $settings; var $presettings;
public function __construct($settings) { global $presettings; $this->settings = $settings; $this->_POST = $_POST; $this->presettings = $presettings; //$this->_POST['imgfile'] = $_FILES['imgfile'];
echo "1"; }
private function checkfilename() { $file_ext = strtolower(substr($_FILES['imgfile']['name'], -4));
if (!in_array($file_ext, array('.jpg','jpeg','.gif','.png'))) { unlink($this->_POST['imgfile']); eval(standard_error(fetch_error('grps_extension_unknown'))); die; }
echo "2"; }
private function makelargecopy() { //if (is_uploaded_file($_FILES['imgfile'])) if (is_uploaded_file($_FILES['imgfile']['tmp_name'])) { $this->imagedimes = getimagesize($_FILES['imgfile']['tmp_name']); $imagewidth = $this->imagedimes[0]; $imageheight = $this->imagedimes[1]; $maxheight = $this->settings['bigimgsize']; $imageog = $imageheight; $imgdimes = array();
if ($imageheight > $maxheight) { $imageproportions = ($maxheight * 100) / $imageheight; $imgdimes['width'] = ($imagewidth * $imageproportions) / 100 ; $imgdimes['height'] = $maxheight; } if ($imageheight <= $maxheight) { $imageproportions = ($maxheight * 100) / $imageheight; $imgdimes['width'] = ($imagewidth * $imageproportions) / 100 ; $imgdimes['height'] = $maxheight; }
$newimagebg = imagecreatetruecolor($imgdimes['width'],$imgdimes['height']);
// Get Mime Type switch ($this->imagedimes['mime']) { case 'image/jpeg': $newimage = imagecreatefromjpeg($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . ".jpg"; imagejpeg($newimagebg, $newfilename, $this->settings['bigimgquality']); break; case 'image/gif': $newimage = imagecreatefromgif($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . ".gif"; imagegif($newimagebg, $newfilename, $this->settings['bigimgquality']); break; case 'image/png': $newimage = imagecreatefrompng($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . ".png"; imagepng($newimagebg, $newfilename, $this->settings['bigimgquality']); break; default: eval(standard_error(fetch_error('grps_upload_error'))); break; } } else { eval(standard_error(fetch_error('grps_upload_error_wtf'))); }
echo "3"; }
private function makethumbcopy() { if (is_uploaded_file($_FILES['imgfile']['tmp_name'])) { $this->imagedimes = getimagesize($_FILES['imgfile']['tmp_name']); $imagewidth = $this->imagedimes[0]; $imageheight = $this->imagedimes[1]; $maxheight = $this->settings['thumbimgsize']; $imageog = $imageheight; $imgdimes = array();
if ($imageheight > $maxheight) { $imageproportions = ($maxheight * 100) / $imageheight; $imgdimes['width'] = ($imagewidth * $imageproportions) / 100 ; $imgdimes['height'] = $maxheight; } if ($imageheight <= $maxheight) { $imageproportions = ($maxheight * 100) / $imageheight; $imgdimes['width'] = ($imagewidth * $imageproportions) / 100 ; $imgdimes['height'] = $maxheight; }
$newimagebg = imagecreatetruecolor($imgdimes['width'],$imgdimes['height']);
// Get Mime Type switch ($this->imagedimes['mime']) { case 'image/jpeg': $newimage = imagecreatefromjpeg($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . "_thumb.jpg"; imagejpeg($newimagebg, $newfilename, $this->settings['thumbimgquality']); break; case 'image/gif': $newimage = imagecreatefromgif($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . "_thumb.gif"; imagegif($newimagebg, $newfilename, $this->settings['thumbimgquality']); break; case 'image/png': $newimage = imagecreatefrompng($_FILES['imgfile']['tmp_name']); imagecopyresampled($newimagebg, $newimage, 0, 0, 0, 0, $$imgdimes['width'], $imgdimes['height'], $imagewidth, $imageheight); $newfilename = $this->settings['imgdir'] . "/" . intval($this->_POST['g']) . "_" . intval($this->_POST['u']) . "_" . TIMENOW . "_thumb.png"; imagepng($newimagebg, $newfilename, $this->settings['thumbimgquality']); break; default: eval(standard_error(fetch_error('grps_upload_error'))); break; }
echo "4"; } else { eval(standard_error(fetch_error('grps_upload_error'))); } } private function cleanup() { imagedestroy($this->newimage); echo "5"; }
public function process() { //print_r($_POST); //print_r($_FILES); //die; $this->checkfilename(); $this->makelargecopy(); $this->makethumbcopy(); $this->cleanup();
echo "got here"; } }
there were some double $$'s in there.
Source: http://community.livejournal.com/php/416624.html
-
Web 2.0
Date: 02/18/06
Keywords: browser, web
Any suggestions for a good Web 2.0 book. My next task seems like as perfect opportunity to learn.
I guess I am really must be refering to only Ajax.
Recently, a concept known as Ajax has evolved that can improve the user experience in some browser-based web applications. It involves a web page requesting an update for some part of its content, and altering that part in the browser, without refreshing the whole page at the same time.
Source: http://community.livejournal.com/php/416335.html
-
Dammit Jim, we're programmers, not interior designers!
Date: 02/17/06
Keywords: php
Need a color scheme? You can drop a couple of colors you like into this page, and it will create some more by mixing the two. Note that the more similar the parent colors are, the more similar the child colors will be to each other and to them. (Enter 000000 and FFFFFF--or any single color twice--for the extremes of this phenomenon.)
The code for that is in the usernotes for image functions on php.net.
Source: http://community.livejournal.com/php/415852.html
-
The MD5 Form
Date: 02/16/06
Keywords: php
I wrote this little doodad in my spare time. I thought some of you might find it useful.
http://www.photocricket.com/md5.php
The code to replicate it is included.
Source: http://community.livejournal.com/php/415736.html
-
Formmail
Date: 02/16/06
Keywords: php, browser, html
Hello all. I'm having some troubles with a formmail script and cannot get the help I need anywhere. I found this community and thought I'd give it a try. This is a script I have used several times before and have had no problems with it. For some reason, I cannot get it to work this time. I don't have a lot of knowledge about PHP, and this is a free script that I tried. I liked it because it worked, but now it's just frustrating me.
This is the HTML form I set up:
< form method="post" action="../php_uploads/comment.php"> Name: < input type="text" name="name" size="30" maxlength="30" /> Address: < input type="text" name="address" size="30" maxlength="30" /> City: < input type="text" name="city" size="20" maxlength="20" /> State: < input type="text" name="state" size="10" maxlength="10" /> Zip: < input type="text" name="zip" size="15" maxlength="15" /> Phone: < input type="text" name="phone" size="20" maxlength="20" /> Email: < input type="text" name="email" size="30" maxlength="30" /> Comments: < textarea name="comments" rows="5" cols="30"> < input name="submit" type="submit" value="Submit Comments"> < input name="reset" type="reset" value="Clear Comments">
This is my formmail code:
$recipient = 'brandi @ wikedawsum.com'; $subject = 'Perfect Pools - Comments Form'; $form_url = 'http://perfectpools.wikedawsum.com/pages/contact.html';
$msg = "---------------\n"; $msg .= "$subject\n"; $msg .= "---------------\n\n"; $msg .= "Name: $_POST[name]\n"; $msg .= "Address: $_POST[address]\n"; $msg .= "City: $_POST[city]\n"; $msg .= "State: $_POST[state]\n"; $msg .= "Zip: $_POST[zip]\n"; $msg .= "Phone: $_POST[phone]\n"; $msg .= "Email: $_POST[email]\n"; $msg .= "Comments: $_POST[comments]\n";
$error_required = '< p>It appears you forgot to enter either your name, your phone number or your email address. Please press the BACK button in your browser and try again.< /p>'; <- This is the error msg I keep getting.
$error_email = '< p>Oops, it appears that the email address you filled in is not a valid one. Please press the back button on your browser and try again. Please check carefully that you filled in all information in the right fields!< /p>';
$success_message = '< p>Your form has been sent. We will contact you in the next few business days regarding your inquiries. Thank you.< /p>';
if ($header ==""){ $use_headers ='0'; $header = ''; } else {$use_headers ='1';} if ($footer ==""){ $use_footers ='0'; $footer = '< div align="center">< a href="http://codegrrl.com/" target="_blank">Powered by NL-PHPMail< /a>< /div>< /body>< /html>'; } else {$use_footers ='1';}
function is_valid_email ($address) { return (preg_match( '/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+'. '@'. '([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,4}$/i', trim($address))); } function is_valid_email_eregi ($address) { return (eregi( '^[-!#$%&\'*+\\./0-9=?A-Z^_`{|}~]+'. '@'. '([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,4}$', trim($address))); }
if (!isset($req1) || !isset($req2) || !isset($req3)) { header( "Location: $form_url" ); }
elseif (empty($req1) || empty($req2) || empty($req3)) { if ($use_headers =="0"){ echo "$header"; } else { include ("$header"); } ?> < h2>Error< /h2> < ?=$error_required?>
< ? if ($use_footers =="0"){ echo "$footer"; } else { include ("$footer"); } } else {
$f_email = $_POST[email]; $f_email = strtolower(trim($f_email)); if (is_valid_email($f_email)) { $msg .= "\n\n---------------\n"; $msg .= "NL-PHPMail v1.5 - http://codegrrl.com/\n"; $msg .= "---------------\n\n";
$mailheaders = "MIME-Version: 1.0 \n"; $mailheaders .= "Content-type: text/plain; charset=iso-8859-1 \n"; $mailheaders .= "From: \"$_POST[email]\" <$_POST[email]> \n"; $mailheaders .= "Reply-To: \"$_POST[email]\" <$_POST[email]> \n"; $mailheaders .= "X-Priority: 3 \n"; $mailheaders .= "X-MSMail-Priority: High \n"; $mailheaders .= "X-Mailer: PHP4";
mail($recipient, $subject, $msg, $mailheaders);
if ($use_headers =="0"){ echo "$header"; } else { include ("$header"); } ?> < h2>Thank You, =$name?>< /h2> < ?=$success_message?>
< ? if ($use_footers =="0"){ echo "$footer"; } else { include ("$footer"); } } else { if ($use_headers =="0"){ echo "$header"; } else { include ("$header"); } ?> < h2>Error< /h2> < ?=$error_email?> < ? if ($use_footers =="0"){ echo "$footer"; } else { include ("$footer"); }
My problem is that everytime I hit the submit button I get my $error_required message (which I bolded up there). I've tried rewriting the script and the form, but nothing seems to work. I'm running out of ideas and am starting to get frustrated. Maybe a new pair of eyes will help?
I apologize for the code being so long. I just wanted to make sure I didn't miss anything. Thanks in advance for any help you guys can provide. I'm also open to suggestions on any other ways to do this more efficiently. I'm sure you guys know a lot more about this than I do. Thanks again!
Source: http://community.livejournal.com/php/415280.html
-
E-commerce starter
Date: 02/15/06
Keywords: php, web, shopping
I've been asked to develop an online store from scratch for a client. I've never done this before. They want to do it all in house and not use a 3rd party system for credit card transactions, shopping carts, etc. Can any recommend any good websites and/or books that I should check out? I'll be writing it in PHP if that makes a difference to any of the recommendations.
Source: http://community.livejournal.com/php/415148.html
-
foreach
Date: 02/15/06
Keywords: php
I can't understand the damn foreach PHP expression. I get that it just assigns the current array element value to the value supplied by $v or $k, but I don't understand the second option (according to php.net manual) that says you can use "$k as $v" and that assigns it to the variable $key on each loop. Wtf is the difference? It's assigning a value to a variable for use in the statement both times - what difference does it make if there's an array key expression in the statement to be evaluated?
Hopelessly lost. Any explanation would be appreciated.
Source: http://community.livejournal.com/php/414789.html
|