Search Results

Search found 33657 results on 1347 pages for 'php frameworks'.

Page 13/1347 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Checking form input data on submit with pure PHP [migrated]

    - by Leron
    I have some experience with PHP but I have never even try to do this wit pure PHP, but now a friend of mine asked me to help him with this task so I sat down and write some code. What I'm asking is for opinion if this is the right way to do this when you want to use only PHP and is there anything I can change to make the code better. Besides that I think the code is working at least with the few test I made with it. Here it is: <?php session_start(); // define variables and initialize with empty values $name = $address = $email = ""; $nameErr = $addrErr = $emailErr = ""; $_SESSION["name"] = $_SESSION["address"] = $_SESSION["email"] = ""; $_SESSION["first_page"] = false; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Missing"; } else { $_SESSION["name"] = $_POST["name"]; $name = $_POST["name"]; } if (empty($_POST["address"])) { $addrErr = "Missing"; } else { $_SESSION["address"] = $_POST["address"]; $address = $_POST["address"]; } if (empty($_POST["email"])) { $emailErr = "Missing"; } else { $_SESSION["email"] = $_POST["email"]; $email = $_POST["email"]; } } if ($_SESSION["name"] != "" && $_SESSION["address"] != "" && $_SESSION["email"] != "") { $_SESSION["first_page"] = true; header('Location: http://localhost/formProcessing2.php'); //echo $_SESSION["name"]. " " .$_SESSION["address"]. " " .$_SESSION["email"]; } ?> <DCTYPE! html> <head> <style> .error { color: #FF0000; } </style> </head> <body> <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Name <input type="text" name="name" value="<?php echo htmlspecialchars($name);?>"> <span class="error"><?php echo $nameErr;?></span> <br /> Address <input type="text" name="address" value="<?php echo htmlspecialchars($address);?>"> <span class="error"><?php echo $addrErr;?></span> <br /> Email <input type="text" name="email" value="<?php echo htmlspecialchars($email);?>"> <span class="error"><?php echo $emailErr;?></span> <br /> <input type="submit" name="submit" value="Submit"> </form> </body> </html>

    Read the article

  • Separate php.ini file for each Apache virtual host?

    - by Calvin L
    Is it possible to have a separate php.ini file that overrides the default php.ini file for each virtual host? I'm running Apache/2.2.14, PHP 5.3.2-1. For example I have several vhosts pointing to domains in my /var/www/ directory: /var/www/website1.com /var/www/website2.com What I'd like is to be able to place a custom php.ini file in each directory that would override the default values only for that vhost, but keep the original defaults if the value isn't specified: /var/www/website1.com/htdocs/ /var/www/website1.com/php.ini EDIT: I found more info on the topic here for those interested: http://serverfault.com/questions/34078/how-do-i-set-up-per-site-php-ini-files-on-a-lamp-server-using-namevirtualhosts

    Read the article

  • Can PHP be run in Apache via mod_php and mod_fcgi side by side?

    - by Mario Parris
    I have an existing installation of Apache (2.2.10 Windows x86) using mod_php and PHP 5.2.6. Can I run another site in a virtual host using FastCGI and a different version of PHP, while stilling running the main site in mod_php? I've made an attempt, but when I add my FCGI settings to the virtual host container, Apache is unable to restart. httpd.conf mod_php settings: LoadModule php5_module "C:\PHP\php-5.2.17-Win32-VC6-x86\php5apache2_2.dll" AddHandler application/x-httpd-php .php PHPIniDir "C:\PHP\php-5.2.17-Win32-VC6-x86" httpd-vhosts.conf fastcgi settings: <VirtualHost *:80> DocumentRoot "C:/Inetpub/wwwroot/site-b/source/public" ServerName local.siteb.com ServerAlias local.siteb.com SetEnv PHPRC "C:\PHP\php-5.3.5-nts-Win32-VC6-x86\php.ini" FcgidInitialEnv PHPRC "C:\PHP\php-5.3.5-nts-Win32-VC6-x86" FcgidWrapper "C:\PHP\php-5.3.5-nts-Win32-VC6-x86\php-cgi.exe" .php AddHandler fcgid-script .php </VirtualHost> <Directory "C:/Inetpub/wwwroot/site-b/source/public"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory>

    Read the article

  • A good php framework in 2012

    - by Jormundir
    I've done a lot of googling around this, and practically all of the answers I find are pre 2011, and are answered in the usual, here are the 5 most popular frameworks... So I'd like to update this topic for 2012, I'm going to build a web application with a pretty complex back-end system driving it, and I'd like to use a framework so I don't have to reinvent the wheel. My application will be hugely user based, so I would appreciate a built in authentication/validation system. (When this is missing it takes me a good 2 weeks of intense and frivolous research to try to pick the "best" one (I don't want to roll my own, I don't think I'd do a better job than what's out there). I've looked into a tried a few, so I'll give you what I like and don't like, but I don't want to bias answers too much. I don't like: Frameworks that auto-generate bloated code. If they have the feature, fine, but if I have to use it, I get frustrated. Backwards compatibility with php4, eww. I don't need backwards compatibility at all. I like: Getting up and running quickly (but without all the auto-generation bogus), what I mean by this is that all the essentials are there, so I don't have to come to a grinding halt to research what the best 3rd party plugin is to get the feature I need. Thorough documentation, good tutorials. Good presentation of these materials. Please explain why your framework suggestion is good, don't just give the name of a framework without any justification. Thanks!

    Read the article

  • Include path of php.ini ignored by Eclipse

    - by Matthieu
    Hi all, I have a PHP script to run. If I run it from the command line, it works fine (include path is set correctly). If I want to run it inside Eclipse (Run as script), then the PHP include path of my php.ini is replaced by Eclipse, with all the libraries I've added to the project. I've configured my PHP executable in Eclipse. I've set the correct PHP executable file, and I selected my php.ini file too (the right one, I've checked). But it is ignored... Help please !

    Read the article

  • Why are action based web frameworks predominant?

    - by deamon
    Most web frameworks are still using the traditional action based MVC model. A controller recieves the request, calls the model and delegates rendering to a template. That is what Rails, Grails, Struts, Spring MVC ... are doing. The other category, the component based frameworks like Wicket, Tapestry, JSF, or ASP.Net Web Forms have become more popular over the last years, but my perception is that the traditional action based approach is far more popular. And even ASP .Net Web Forms has become a sibling name ASP .Net Web MVC. I think the kind of applications built with both types of frameworks is overlapping very much, so the question is: Why are action based frameworks so predominant?

    Read the article

  • Which are the best techniques to protect a 'homemade' framework from unlogged visitors?

    - by Hermet
    First of all, I would like to say that I have used the search box looking for a similar question unsuccessfully, maybe because of my poor english skills. The way I currently do this is checking in every single page that a session has been opened. If not, the user gets redirected to a 404 page, to seem like the file which has been requested doesn't exist. I really don't know if this is sure or there's a better and more safety way and I'm currently working with kind of confidential data that should never become public. Could you give me some tips? Or leave a link where I could find some? Thank you very much, and again excuse me for kicking the dictionary.

    Read the article

  • Apache is not interpreting .PHP files

    - by Ala ABUDEEB
    I recently downloaded OpenSUSE OS version 11.4 from the site to use it as a server..In order to do that I downloaded the server edition that has Apache/2.2.17 and PHP5 downloaded by default.....Ok till now it is fine Now I started the Apache successfully and put a test.php file in the documentRoot directory. test.php contain only <?php phpinfo() ?> Then using my browser I typed http://localhost/test.php and here was the problem the browser didn't display what phpinfo() should display, instead it asked me whether I want to open or save test.php...which is driving me crazy.... I googled a lot but no solution THis is /etc/apache2/conf.d/php5.conf (IfModule mod_php5.c) AddHandler application/x-httpd-php .php4 AddHandler application/x-httpd-php .php5 AddHandler application/x-httpd-php .php AddHandler application/x-httpd-php-source .php4s AddHandler application/x-httpd-php-source .php5s AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php (/IfModule)

    Read the article

  • How to config PHP libxml path after updated libxml from 2.2.26 to 2.9

    - by Cauliturtle
    our servers need to update the libxml2 version from 2.2.26 to 2.9 (latest version). It is no problem that we have been installed the libxml2-2.9 version on our servers. but the problem is how can we config the libs path of libxml2 path in php? Since it still show the old version on phpinfo(). What we have do is 1. Install libxml2 2.7.X on CentOS 5.X Using yum to install local files, and typed yum info libxml2, it shows 2.9 was installed. Thanks!

    Read the article

  • PHP CodeSniffer: indentation of 2 is ignored, it just checks 4

    - by Olivier Pons
    # phpcs --version PHP_CodeSniffer version 1.3.3 (stable) by Squiz Pty Ltd. (http://www.squiz.net) # Trying to do this: phpcs --tab-width=2 includes/json/item/categorie.php FOUND 29 ERROR(S) AND 3 WARNING(S) AFFECTING 24 LINE(S) Doesn't work. This doesn't work too: phpcs includes/json/item/categorie.php --tab-width=2 FOUND 29 ERROR(S) AND 3 WARNING(S) AFFECTING 24 LINE(S) If I indent the file with 4 spaces (which I don't want): phpcs --tab-width=2 includes/json/item/categorie.php FOUND 4 ERROR(S) AND 3 WARNING(S) AFFECTING 17 LINE(S) phpcs --tab-width=4 includes/json/item/categorie.php FOUND 4 ERROR(S) AND 3 WARNING(S) AFFECTING 17 LINE(S) phpcs --tab-width=50 includes/json/item/categorie.php FOUND 4 ERROR(S) AND 3 WARNING(S) AFFECTING 17 LINE(S) phpcs includes/json/item/categorie.php --tab-width=50 FOUND 4 ERROR(S) AND 3 WARNING(S) AFFECTING 17 LINE(S) So it's totally ignored. It this a bug?

    Read the article

  • Mod_rewrite and urls that don't end with .php

    - by Kevin Laity
    I'm trying to use Mod_rewrite to hide the .php extensions of my pages. However, it refuses to do any rewriting unless the input url ends with .php, which makes that impossible. I can confirm that rewriting works fine as long as the url has .php at the end. RewriteRule a\.php b\.php Works, while RewriteRule a\.html b\.html does not. How can I turn off this behavior and allow it to rewrite all urls? I'm on a shared host so whatever I do has to be done from a .htaccess file. Update: There seems to be some confusion about what I'm asking here. The question is not about how to write the rule, the question is about server configuration. The rule I'm using is fine, I can test that locally. But the server I'm working with is somehow configured so that mod_rewrite doesn't attempt to rewrite anything that doesn't end with .php

    Read the article

  • Mod_rewrite and urls that don't end with .php

    - by Kevin Laity
    I'm trying to use Mod_rewrite to hide the .php extensions of my pages. However, it refuses to do any rewriting unless the input url ends with .php, which makes that impossible. I can confirm that rewriting works fine as long as the url has .php at the end. RewriteRule a\.php b\.php Works, while RewriteRule a\.html b\.html does not. How can I turn off this behavior and allow it to rewrite all urls? I'm on a shared host so whatever I do has to be done from a .htaccess file. Update: There seems to be some confusion about what I'm asking here. The question is not about how to write the rule, the question is about server configuration. The rule I'm using is fine, I can test that locally. But the server I'm working with is somehow configured so that mod_rewrite doesn't attempt to rewrite anything that doesn't end with .php

    Read the article

  • Whats the thing the report bugs in php?

    - by Max Hazard
    Currently I am learning php. Php is understood by browser itself right from php sdk right? SDK include libraries right? So browser is like an interpreter of php codes. I want to know that whenever I type a wrong php syntax what is the thing report me the error? Obviously the browser is reporting the error. But what part of it? I mean I don't get it. Like writing a compiler we do lexical analysis and make the compiler which report any bug in source code. I assume here browser is analogous to compiler. I don't know exactly but compiler contains bug report functions or methods which is debugger. Debugger is part of compiler which report bugs. Does the browser contains such debuggers? Can there be any browser which doesn't understand php?

    Read the article

  • Learning PHP OOP

    - by Ryan Murphy
    I have been coding PHP for about 2 years now and I THINK that I have a very good grasps of the fundamental parts of PHP, i.e. Functions foreach/IF statements sessions/cookies POST/GET Amongst a few others. I want to move on to learning OOP PHP now, so learning how to use classes and making it a really valuable skill. I have 1 requirement, the source must be a respected source that doesn't teach developers bad habits. I have the book: PHP and MySQL Web Development However, as useful as that is I would like an online source. I would like to know from people with experience in OOP PHP, how and where did they learn OOP PHP. Obviously by doing, but I would really appreciate some great resources which help me along the way.

    Read the article

  • "PHP: Good Parts"-ish book / reference

    - by julkiewicz
    Before I had my first proper contact with Javascript I read an excellent book "Javascript: The Good Parts" by Douglas Crockford. I was hoping for something similar in case of PHP. My first thought was this book: "PHP: The Good Parts" from O'Reilly However after I read the reviews it seems it totally misses the point. I am looking for a resource that would: concentrate on known shortcommings of PHP, give concrete examples, be as exhaustive as possible I already see that things can go wrong. If you want to close this question: Please consider this, I looked through SO, and Programmers for materials. I obviously found this question: http://stackoverflow.com/questions/90924/what-is-the-best-php-programming-book It's general, mine is specific. Moreover I'm reading the top recommendation "PHP Objects, Patterns, and Practice" right now. I find it insufficient -- it doesn't address the bad practices as much as I would like it to. tl;dr My question is NOT a general PHP book request.

    Read the article

  • adding regular expression in php not work

    - by John Smiith
    Code i added ([a-zA-Z0-9\_\-]+) but not work i wan't to include all css files is there is any other way to add?? My code file css.php header("Content-type: text/css"); $css = array( '([a-zA-Z0-9\\_\\-]+).css', ); foreach ($css as $css_file) { $css_get = file_get_contents($css_file); echo $css_get; } call.php <link href="css.php" rel="stylesheet" type="text/css" /> i wan't to rewrite css.php to css.css so public can see css.css instead of css.php. how can i do that using php script?

    Read the article

  • Where to find PHP version usage stats?

    - by Darren Cook
    My original question was: what percentage of sites are using php 5.4.x? (As it has some very interesting new features.) With secondary questions like how many of the cheap web hosting places have upgraded, which versions of the linux distros include it, etc. But I'm coming up blanks. http://php.net/usage.php stops at July 2007, and the nexen.net website seems to have stopped in 2008. At SecuritySpace they only list the web servers, not php versions. The TIOBE link isn't what I'm after (it doesn't -- and couldn't -- break down by version number. I thought php.net might show download numbers, but I cannot see them anywhere. I kind of answered the distro question, but it requires a lot of clicking around at distrowatch.com. E.g. I see here that Ubuntu offers php 5.4.6 in the latest snapshot, but the latest release (Ubuntu 12.04) has 5.3.10.

    Read the article

  • Fitting an established site into a CI framework

    - by David
    I manage a rather large, feature full nightmare of a site which has no end of feature creep settings/options/etc. Up to now its been coded in a procedural/functional way and would like to move to an OO,MVC setup. I'm quite new to it all but have done alot of research and feel that CodeIgniter is a code choice of framework to use to help quicken the transfer. Before looking at a framework, I started constructing a list of objects to create classes out of: photos users forum topics forums blogs blog posts comments The trouble I have now, is I do understand where these generic/universal objects fall into the CI MVC setup. What is the best way to organise this kind of stuff? These classes can generally be used on multiple models/views/controllers.

    Read the article

  • Modern workflow / project architecture with PHP

    - by Sprottenwels
    I wonder how one professional developer would design the backend-part of his application. I try to use PHP as seldom as possible and only for data serving/saving purposes. To do so, i would create a module/class for every greater part of my application, then write some single script files which are called by javascript. E.g: User clicks a "retrieve data" button javascript will call retrieveData.php retrieveData.php will create an instance of the needed class, then executes myInstance-retrieve() the data is returned to my JS by retrieveData.php However, i see some disadvantages in this practice: I will need a single scipt file for every action, (e.g retrieveData.php, saveData.php etc) I need a man-in-the-middle step: from JS to my single script, to my classes How are modern applications designed to accomplish what i need to do?

    Read the article

  • Running mod_php and suPHP same time

    - by BHare
    I recently went from Debian Lenny with 5.2.x and was able to use mod_php for any php files that were not located in /home/ and suPHP for all the php files that were located in /home/. I did this because I needed a default php.ini (given me all features of php) for my websites in /var/www/ and I didn't want to have to change the owner of all the .php files from root. I also had a default php.ini for all the /home/ php files without dangerous features. This was I had setup: <IfModule mod_suphp.c> <Directory /home/> AddType application/x-httpd-php .php .php3 .php4 .php5 suPHP_AddHandler application/x-httpd-php suPHP_Engine on suPHP_ConfigPath /home/shared/ </Directory> </IfModule> This was working perfect, but recently I upgraded to PHP to 5.3.5 from dotdeb (Lenny has no official php 5.3) . This had weird issues on lenny such as not display errors correctly and little tid bits. So I decided to upgrade from lenny to squeeze. Uninstalled php (along with it came suphp) and reinstalled with the new source. I now have 5.3.3-7 with Debian Squeeze but I cannot get mod_php and suPHP to run at the same time anymore. mod_php will always work and there are no errors in apache2 or suphp logs. If I disabled mod_php then suPHP will work. Is there thing I am doing wrong?

    Read the article

  • procmail don't execute php script

    - by Phliplip
    Hi, I have setup a kannel SMS gateway on my FreeBSD 7.2 - the service works great. I'm now trying to setup a email2sms feature. For this i have created a system user called kannel and all mails are forwarded to this user. In the home dir of kannel i have the following files. -rw-r--r-- 1 kannel kannel 81B 17 jan 09:50 .procmailrc lrwxr-x--- 1 root kannel 58B 14 jan 13:24 email2sms.php @ -> some-what-some-where -rw-rw-rw- 1 root kannel 5,8K 17 jan 09:52 log.email2sms -rw------- 1 kannel kannel 1,3K 17 jan 09:50 procmail.log -rw-r----- 1 root kannel 606B 14 jan 13:28 rawmail.txt The file email2sms.php is a symlink to the a php script (ZendFramework Application) that takes the email from STDIN, and uses ZendFramework to parse that mail into an object. It then do a http request to the SMS gateway. The php-script works. Content of .procmailrc LOGFILE=$HOME/procmail.log VERBOSE=yes :0 | php email2sms.php >> log.email2sms From last sent email i have this in procmail.log procmail: [97744] Mon Jan 17 09:50:40 2011 procmail: [97744] Mon Jan 17 09:50:40 2011 procmail: Assigning "LASTFOLDER= php email2sms.php >> log.email2sms" procmail: Executing " php email2sms.php >> log.email2sms" procmail: Notified comsat: "kannel@:/home/user/kannel/ php email2sms.php >> log.email2sms" From [email protected] Mon Jan 17 09:50:40 2011 Subject: asdf as Folder: php email2sms.php >> log.email2sms 2600 But there is no new output to log.email2sms, and the script should output the subject of the email. If i sudo as the kannel user and pipe a file with raw email to the script, it executes just fine. [root@webserver /home/user/kannel]# /home/user/kannel/ sudo -u kannel cat rawmail.txt | php email2sms.php >> log.email2sms And the command outputs to log.email2sms as desired. Any ideas guys?

    Read the article

  • Friendly PHP framework for a newbie?

    - by dineshbabu
    Hello people, I am given a task to convert a crappy(non-secure) hardcoded website into a good one using any good framework. I have a good idea of PHP. So can you help me in choosing a framework? Also, do i need to learn about Model View Controller to use frameworks?

    Read the article

  • Do PHP Framworks Speed Up the Development Process?

    - by Jacob
    I recently started working for a web firm as a freelancer taking my hobby of coding in PHP to a career level, and since then I have been overwhelmed by the amount of work that needs to be done within short time frames. The problem isn't being able to do what is asked, but being able to do it all as quickly as is needed of me. I never used any PHP frameworks, but if I started using one, would that speed up the entire development process? If so, how drastically? Also which framework would be best for my purpose? If it matters, what I do is mostly build back end cms's and tie that with front end functionality for small business client sites.

    Read the article

  • php includes that include another php file

    - by Emma
    I'm getting really muddled up now and my brain hurts! :( lol Root: index.php Includes: cat.php dog.php index includes dog: include("includes/dog.php"); dog includes cat: include("cat.php"); When I run index, for cat it says: A link to the server could not be established Access denied for user ... However, if I run dog, I get no problems... I'm guessing its the path, but i've tried ./includes/cat.php to no joy...

    Read the article

  • including php file from another server with php

    - by ermac2014
    hi I have 2 php files each file on different server. lets say the first file called includeThis.php and the second called main.php the first file is located in (http://)www.sample.com/includeThis.php and the second located in (http://)www.mysite.com/main.php so now what I want is to include the first file into my second file. the contents of the first file is like: <?php $foo = "this is data from file one"; ?> the second file like: <?php include "http://www.sample.com/includeThis.php"; echo $foo; ?> is there any way I can do this? thanks in advance

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >