sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
Use AND instead of commas in your query (the error is showing you where to start).
-
I've got a Ubuntu server, and I have name based virtual hosting. The server is on a dynamic IP, and I use zoneedit/ddclient to keep it running 24/7. The server has the typical LAMP installation, and has phpMyAdmin installed, but I'm wondering how to let each website have its own installation of phpMyAdmin, or how to let all the websites use the same installation, but keep it secure. Also, I currently use Filezilla3 and its SFTP connection to move files back and forth, but how would I set up regular FTP so that a website owner could only access their account? Do I only install phpMyAdmin and FTP once, and then configure them, or is there a better way of doing it? I've tried searching for some tutorials, but haven't come across anything. The current O/S could be scrapped and I could start from scratch if it matters, but I do want to stay with either Debian or Ubuntu.
-
Corbin, I do have Flash, so I can make the FLV. I've never embedded a WMP object. Thanks for the advice. xtopolis, I've looked at the Flash Media Server before, but it's not free, and seemed complicated. Thanks for your reply too.
-
My wife is getting into editing video, and she makes some huge file size videos. We compress them, but I don't really know how to have them streamed or whatever needs to be done to get them to play decently on the web. I'm definitely not looking for anything advanced, but would appreciate if anyone has a tutorial about this.
-
If you've done this before, it seems that it should work. Are you on the same server? Are there any redirects involved? Perhaps FOLLOWLOCATION would help?
-
Maybe procedural coding would be easier for you. I can use OOP, but prefer procedural.
-
If you have the time, the PHP security video at: http://videos.code2design.com/video/play/PHP/11 is great for beginners, and even for anyone that just needs to brush up on php security. There are other php videos at http://code2design.com as well, and while they are more geared towards the beginner, I have nothing bad to say.
-
If you decide to use Postfix, you might want to buy the nostarch press Postfix book, or you'll be pulling your hair out! I set up postfix successfully, but it was no easy task, and once I got the book it made things a lot more clear.
-
To get at your sf namespace elements, you need to replace dc with sf. http://purl.org/dc/elements/1.1/ is the description of the dc namespace, but looking at your xml, you might need to get at the sf namespace through the getNamespace function. This URI is kinda like a description of what is inside the sf namespace, and what form of data is there. BTW, the XML that you shared does not look valid. Where did you get it? Maybe if you can share the source, and hook me up with the URI, I'll try to parse it for you.
-
I have Chrome at work, but not here at home, so I just downloaded it. I don't see the problems you are describing, so I don't know what to say. Maybe it is your screen resolution or something?
-
OK, you should have looked at NAMESPACES better, because sf IS a namespace. Take a look at http://www.sitepoint.com/blogs/2005/10/20/simplexml-and-namespaces/ for more info about namespaces. You can also use getDocNamespaces() or getNamespaces(), and here is more info on it: http://www.w3schools.com/php/func_simplexml_getdocnamespaces.asp http://www.w3schools.com/php/func_simplexml_getnamespaces.asp Also see the php manual (but there are no examples). As soon as you declare the namespaces the corrent way, you will be able to start parsing those elements.
-
Maybe there are queues that are being processed at each relay or MTA, and this creates a bottleneck that there is no way of knowing. Other than some semi-educated guesses, I just don't know.
-
you could specifically check like this: if(isset($_POST['name']) && $_POST['name'] != ''){ ... or if(empty($name) || $name == ''){ ...
-
You have to have GD 2.0.1 or higher installed, and this only works on php5. I probably should have mentioned that earlier.
-
The -f option looks more "normal", but if they both came through fast, then perhaps something in your version of the email was being flagged as spammy? There's a lot to think about when sending HTML and/or text email. Certain keywords or phrases may count against you. Having links in your email may count against you. MTAs can greylist you, and make you wait XX amount of minutes before your email goes through. They may do a reverse MX lookup on your email address to verify that it actually exists, etc, etc. Once when I was testing my server, I sent myself a virus to see if my virus checker was functioning, and somebody somewhere red listed my server and I couldn't send emails! I don't remember who it was, but there is a lot going on when you send an email, and most people don't have a clue. I don't think there was a real problem with your host. You probably just have to work on what you are sending.
-
the -f is the "f option" and is a "from name"
-
This is the thumbnail generator class (ThumbnailImage.php) that I use: <?php //requires GD 2.0.1 or higher //note about gif class ThumbnailImage{ private $image; //not applicable to gif or png private $quality = 100; private $mimetype; private $imageproperties; private $initialfilesize; //////////////////////////////////////////////////////// //constructor //////////////////////////////////////////////////////// public function __construct($file, $thumbnailsize = 100){ //check path is_file($file) or die ("File: $file doesn't exist."); $this->initialfilesize = filesize($file); $this->imageproperties = getimagesize($file) or die ("Incorrect file type."); // new function image_type_to_mime_type $this->mimetype = image_type_to_mime_type($this->imageproperties[2]); //create image switch($this->imageproperties[2]){ case IMAGETYPE_JPEG: $this->image = imagecreatefromjpeg($file); break; case IMAGETYPE_GIF: $this->image = imagecreatefromgif($file); break; case IMAGETYPE_PNG: $this->image = imagecreatefrompng($file); break; default: die("Couldn't create image."); } $this->createThumb($thumbnailsize); } //////////////////////////////////////////////////////// //destructor //////////////////////////////////////////////////////// public function __destruct(){ if(isset($this->image)){ imagedestroy($this->image); } } //////////////////////////////////////////////////////// //public methods //////////////////////////////////////////////////////// public function getImage(){ header("Content-type: $this->mimetype"); switch($this->imageproperties[2]){ case IMAGETYPE_JPEG: imagejpeg($this->image,"",$this->quality); break; case IMAGETYPE_GIF: imagegif($this->image); break; case IMAGETYPE_PNG: imagepng($this->image); break; default: die("Couldn't create image."); } } //////////////////////////////////////////////////////// public function getMimeType(){ return $this->mimetype; } //////////////////////////////////////////////////////// public function getQuality(){ $quality = null; if($this->imageproperties[2] == IMAGETYPE_JPEG){ $quality = $this->quality; } return $quality; } //////////////////////////////////////////////////////// public function setQuality($quality){ if($quality > 100 || $quality < 1){ $quality = 75; } if($this->imageproperties[2] == IMAGETYPE_JPEG){ $this->quality = $quality; } } //////////////////////////////////////////////////////// public function getInitialFileSize(){ return $this->initialfilesize; } //////////////////////////////////////////////////////// //private methods //////////////////////////////////////////////////////// private function createThumb($thumbnailsize){ //array elements $srcW = $this->imageproperties[0]; $srcH = $this->imageproperties[1]; //only adjust if larger than reduction size if($srcW >$thumbnailsize || $srcH > $thumbnailsize){ $reduction = $this->calculateReduction($thumbnailsize); //get proportions $desW = $srcW/$reduction; $desH = $srcH/$reduction; $copy = imagecreatetruecolor($desW, $desH); imagecopyresampled($copy,$this->image,0,0,0,0,$desW, $desH, $srcW, $srcH) or die ("Image copy failed."); //destroy original imagedestroy($this->image); $this->image = $copy; } } //////////////////////////////////////////////////////// private function calculateReduction($thumbnailsize){ //adjust $srcW = $this->imageproperties[0]; $srcH = $this->imageproperties[1]; if($srcW < $srcH){ $reduction = round($srcH/$thumbnailsize); }else{ $reduction = round($srcW/$thumbnailsize); } return $reduction; } }//end class //////////////////////////////////////////////////////// ?> This is the file (getthumb.php) called by the source of the img tag: <?php //this file will be the src for an img tag require 'ThumbnailImage.php'; $path = @$_GET["path"]; $maxsize = @$_GET["size"]; if(!isset($maxsize)){ $maxsize=100; } if(isset($path)){ $thumb = new ThumbNailImage($path, $maxsize); $thumb->getImage(); } ?> Usage: <img src="getthumb.php?path=../big_pics/Access_road_n_mountains.jpg&size=256" alt= "Access road n mountains" /> Give it a try.
-
I think you should go with the most simple mail() implementation, just for testing purposes, and see what happens. <?php // A test script for sending mail. Put your email address below // and open this script in your browser. $ADDR = "you@yourhost.com"; if (mail($ADDR,"Testing","This is a test")) echo "Mail function succeeded<br />"; else echo "Mail function FAILED<br />"; ?> if that doesn't work try this: <?php // A test script for sending mail. Put your email address below // and open this script in your browser. $ADDR = "you@yourhost.com"; if (mail($ADDR,"Testing with -f","This is a test","From: $ADDR","-f$ADDR")) echo "Mail function succeeded with -f parameter<br />"; else echo "Mail function FAILED with -f parameter<br />"; ?> If you do these tests, and one of them should obviously work, then your host really can't say much about the script. You should check the headers, and see what's happening as it relays. Some ISPs or mail services can hold an email back from being delivered for various reasons.
-
if sf is a namespace, then it needs to be declared. SimpleXML will do this for you if you check out the docs.
-
Isn't jquery just a javascript library? I've never heard of a javascript login system.
-
I keep seeing people who need a nice login system. I've developed a nice one, and posted pieces of it here a few times. I think it would be great to get some seasoned php programmers together and make an open source login system for distribution here at phpfreaks. If anyone is interested, let me know.
-
It would be better if you could share some code, or link us up.
-
I've changed hosts 3 or 4 times. They all use latest PHP which has it set so that FOLLOWLOCATION can't be used when safe_mode or open_basedir is on. It's because someone could CURL to a script on their server which says <?php header("Location: ..."); ?> which displays files on that server(it's an LFI) I'm on an InMotion Hosting server (inmotionhosting.com), and am using FOLLOWLOCATION. I'm on their biz30 server, and php runs as CGI, and I believe with SuPHP enabled, but I might be wrong. They put me on this server because I needed php sendmail enabled, and by default it is disabled. I guess if scripts turn an account into a spam relay or something, then they can easily identify it and shut it down. You can view the phpinfo if you are interested: http://biz30.inmotionhosting.com/phpinfo.php I use FOLLOWLOCATION because my contact forms post to a mail processing script through cURL, and the result is output after redirection. I am really pleased with this host, but after changing hosts 3 or 4 times, I can see why you'd be reluctant to change again.
-
none of the code that you have shown has an array.