Thursday, July 30, 2009

Can I use PHP without an Internet connection?

I've heard that you can use PHP without an internet connection. I've also heard that you can't, because you need a server. But, I've heard again that you can use a server side DBMS (if I recall correctly) on a disconnected computer. I'm just trying to find the truth. Thanks in advance!

Can I use PHP without an Internet connection?
YES! You most certainly can run PHP without an internet connection. But whether its useful to do so really depends on what you're using PHP for. PHP is best for creating web-based application which can be (but not necessarily) used online.





You can install a PHP/Web Server environment on your PC/Notebook. People normally do this for developing their PHP applications before uploading the completed application to an online hosting provider.





This article shows you how to install a PHP environment on a portable storage device, so that you can bring it with you where-ever you go. Neat right?


http://www.askaboutphp.com/beginners/7/i...
Reply:Of course you can.. you just need to run a web server on the same PC as you run your editor. A server isn't hardware, it's software. Just run a web server (Apache or whatever) on your PC, install PHP on it, and you got yourself a PHP-enabled server.
Reply:Yep, you can use PHP without the Internet - running a local webserver.


How does joomla work and do i need php/mysql knowledge to use it?

am quite a novice in database driven web design, and i want to try out joomla. i have no knowledge on php or mysql

How does joomla work and do i need php/mysql knowledge to use it?
Well most of the PHP/MySql CMS systems will need you to have some experience with PHP and MySql to be highly effective, but not to just use one. Once installed and running you really don't need that unless the site errors for some reason.





Since you want to learn why don't you download it and run it locally. You can easily install your own web server on your computer and then learn locally.





Or download it and install it on your web server in a sub directory and play. learn, design away!





The best way is DIG IN! Joomla is not too hard to learn. The setup is fairly easy and in some cases even automated so just install it and see. You will surprise yourself.

eurovision song contest

Is there any issues over directory seperators in php?

If a website is hosted on a Windows machine and I write:


include '../myfile.php';





will this cause a problem?

Is there any issues over directory seperators in php?
It's gonna work fine on both Windows and Linux platforms . The only difference between these two while including a file is that file names are case sensetive in Linux .


Suppose your file name is "MYfIlE.phP" and you're running your code on a Linux machine ,then your code must be like this :


include('../MYfIlE.phP');





In a Windows machine it doesn't matter whether you write it in Upper case and or Lower case.


How do I create an interactive website with PHP and mySQL?

I created my website cosmetics with Frontpage 2003. Now I want to throw in some PHP code to create user sessions, as well as transmit all of the information the visitors insert on the registration page to a mySQL database. Is there a program/script out there to simplify this process? If avoidable, I would like to not write out all the entire script from scratch.

How do I create an interactive website with PHP and mySQL?
What you're describing will not require much code. There's no reason not to write it from scratch.





But check out Fusebox ( http://www.fusebox.org ), which will make your life a lot easier.





Edit: Despite what The First said, ColdFusion (CFML) and PHP are similar; in fact, CFML predates PHP. I program in both languages; PHP is probably easier to learn and arguably more easily extensible than CFML. Certainly it's no worse.
Reply:Why would you use PHP in the first place? Its an old outdated and useless langauge. Use Coldfusion instead. It's more robust, powerful and faster (then PHP).





That being said, do a google search on what features you want on the site and see if there are any sample codes that you can review. Creating a user session, members only (authentication) system, guestbooks, etc are all common tasks in any language. If you switch to coldfusion, lemme know I can help.


How to send mail from window server using php ?

I have a hosting account at windows server (Windows NT build 2195 )


i try to send mail with php code but it is not working .


all help are accepted .

How to send mail from window server using php ?
OK first lets differentiate two things. There is an application server that runs the application I assume this is the windows server you are talking about? If it is does it even support PHP? Most windows servers do not support PHP Nativity. Usually Apache servers are used to run PHP code. PHP uses the Nativity built "mail" function to send emails. This function uses SMTP to send the email and has to be attached to a server mechanism that allows for the email to be sent.


See:


http://www.php.net/mail





Hope that helped some


Are there any free php shopping carts for google checkout or paypal payments pro?

Hello, trying to setup a shopping cart on my site. The only php carts that do what I need are x-cart or sunshop, but seem to cost $200 bucks. Is there a free php script out there that will let me process credit cards with my paypal pro, or google checkout account (without making my customer "sign up" for paypal or google checkout)





I know this is kind of technical, but I really need the help!

Are there any free php shopping carts for google checkout or paypal payments pro?
[1] Details of Google Checkout, i'm sure you've already been there





[2] tutorials for building your own shopping cart





[3] A comprehensive list of carts supported by Google Checkout
Reply:try OSCommerce http://oscommerce.com or Zen Cart http://zen-cart.com or maybe Cube Cart as well http://cubecart.com
Reply:I don't know...GOOGLE IT!! W00T!

wedding song

How do I resize pictures in PHP without loosing quality?

I am writing a PHP script where you can upload pictures and they automatically get resized to three different thumbnails. Everything works fine, except that the quality of the generated thumbnails is nothing like I would like it to be. Anyone have suggestions what I can do?





Thank you.

How do I resize pictures in PHP without loosing quality?
It depend how you resize


If you are just changing the dimensions that means you are loosing quality


You should use software attached to your script to modify the pixels, or you can do it with Java


Try to add a java command to reduce the pixels with the dimensions,


Good luck
Reply:%26lt;?php





function imageResize($width, $height, $target) {





//takes the larger size of the width and height and applies the


formula accordingly...this is so this script will work


dynamically with any size image





if ($width %26gt; $height) {


$percentage = ($target / $width);


} else {


$percentage = ($target / $height);


}





//gets the new value and applies the percentage, then rounds the value


$width = round($width * $percentage);


$height = round($height * $percentage);





//returns the new sizes in html image tag format...this is so you


can plug this function inside an image tag and just get the





return "width=\"$width\" height=\"$height\"";





}





?%26gt;
Reply:I think, there has several commands but try this


imagecopyresampled();





Have a look those links





http://www.vipercreations.com/tutorials/...





http://www.webmasterworld.com/forum88/80...





http://uk.php.net/gd





http://blazonry.com/scripting/upload-siz...





http://aspn.activestate.com/ASPN/docs/PH... - Php image function





http://www.spinwave.com/index.php - Image compression program
Reply://This will set a image's dimensions to be within a certain width %26amp; height you want with the width %26amp; height being in proporation.


$widthYouWant = 150; //This can be any size you set


$heightYouWant = 150;//This can be any size you set





//This is the full image name and location


$image = "http://" . $_SERVER['HTTP_HOST'] . "/" . $directoryName . "/" . $imageName;


if(is_file($image)){ //makes sure the file is an actual file





list($width, $height, $type, $attr) = getimagesize("img/flag.jpg"); //gets the size of the image





//This will set a width to a certain width you want


if($width %26gt; $widthYouWant){


$widthDivider = $width/$widthYouWant;


$width = $widthYouWant;


$height = $height/$widthDivider;


}


//Size will already be set in proportion to a width being max 150 pixels


if($height %26gt; $heightYouWant){


$heightDivider = $height /$heightYouWant;


$width = $width/$heightDivider;


$height = heightYouWant;


}





}


else{


$error = "File doesn't exist.";


}





//set the image tag with width="%26lt;?=$width?%26gt;" height="%26lt;?=$height?%26gt;"