Search Results

Search found 31819 results on 1273 pages for 'sphinx php'.

Page 115/1273 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • I want to store a php $_SESSION variable and retrieve it on another page.

    - by CDeanMartin
    <?php session_start(); // store session data $_SESSION['count']=0; ?> <html><head></head> <body> <?php include ("getElement.php"); echo getLinkButton("myscript.php", "myscript.php"); echo $_SESSION['count']++; ?> </body> </html> The code above works, but when I click the link to navigate to myscript.php: <?php echo $_SESSION['count']; ?> I get this error: Undefined variable: _SESSION in /home/ubuntu/public_html/myscript.php on line 2

    Read the article

  • post values to external page explicitly PHP

    - by JPro
    Hi, I want to post values to a page through a hyperlink in another page. Is it possible to do that? Let's say I have a page results.php which has the starting line, <?php if(isset($_POST['posted_value'])) { echo "expected value"; // do something with the data } else { echo "no the value expected"; } If from another page say link.php I place a hyperlink like this: <a href="results.php?posted_value=1"> , will this be accepetd by the results page? If instead if I replace the above starting line with if(isset($_REQUEST['posted_value'])), will this work? I believe the above hyperlink evaluates to GET, but since the only visibility difference between GET and POST that is you can see parameters in the address bar with GET But, is there any other way to place a hyperlink which can post values to a page? or can we use jquery in the place of hyperlink to POST the values? Can anyone please suggest me something on this please? Thanks.

    Read the article

  • What is good about php/what is php good for?

    - by Roman A. Taycher
    I have often seen php bashed around the webs as a loosely typed(loose typing as in a lot of type coercion and/or easy(and perhaps common) to cast object all over not dynamic typing) language without a great compiler/interpreter/vm, with even the standard library using a number of different naming conventions. A lot of people complain about perl but many (including a lot of the complainers) also give it a lot of credit for its regexes and general flexibility and power. Other then legacy code , giant web frameworks that can do tons(drupal,ect.), and easy cheap hosting what is good about php (,also what criticism are unfair, and how is the language evolving to overcome its problems). Why would i want to learn it? why would I want to do an independent project in it? The main thing I have heard is that its php codes simplicity is sometimes easier then the over-engineered complexity you find in certain Java frameworks and applications. I'm not just trolling, i'm genuinly curious what makes php programmers use it. try to convince me to put it on my languages to dabble in and languages to learn more in depth lists.

    Read the article

  • Passing Javascript value to PHP Variable using ajax

    - by shels
    I am trying to use a Flash detection script to assess whether Flash Plugin is enabled in the user browser so that a different page loads. The Flash detection script is as follows, using jquery 1.8.2 and jquery.jqplugin 1.0.2 <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript" src="jquery.jqplugin.1.0.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#withflash").hide(); $("#noflash").hide(); if ($.browser.flash == true) $("#withflash").show (); else $("#noflash").show (); }); </script> <div id="withflash">Flash Supported</div> <div id="noflash">Flash Not Supported</div> I get the display that "Flash Supported" if Flash Plugin is present.. I need to capture the value whether flash plugin value is true in a php variable $hasFlashSupport as below: <?php echo " $hasFlashSupport"; exit; ?> I am aware that PHP is server based and Javascript is client based.. Hence Ajax would be a nice option to capture the javascript variable to my php variable. I am totally ignorant about Ajax syntax and how to achieve it. Request the experts here to help me out with the code on how this can be achieved... Thanking all of you in advance..

    Read the article

  • PHP & MySQL storing multiple values in a database.

    - by R.I.P.coalMINERS
    I'm basically a front end designer and new to PHP and MySQL but I want a user to be able to store multiple names and there meanings in a MySQL database table named names using PHP I will dynamically create form fields with JQuery every time a user clicks on a link so a user can enter 1 to 1,000,000 different names and there meanings which will be stored in a table called names. All I want to know is how can I store multiple names and there meanings in a database and then display them back to the user for them to edit or delete using PHP MySQL? I created the MySQL table already. CREATE TABLE names ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, userID INT NOT NULL, name VARCHAR(255) NOT NULL, meaning VARCHAR(255) NOT NULL, PRIMARY KEY (id) ); Here is the HTML. <form method="post" action="index.php"> <ul> <li><label for="name">Name: </label><input type="text" name="name" id="name" /></li> <li><label for="meaning">Meaning: </label><input type="text" name="meaning" id="meaning" /></li> <li><input type="submit" name="submit" value="Save" /> <input type="hidden" name="submit" value="true" /></li> </ul> </form>

    Read the article

  • PHP site scheduling Java execution?

    - by obfuscation
    I'm trying to get started on combining my (slightly limited) PHP experience with my (better) Java experience, in a project where I need to allow uploads of Java source files to the server, which the server then executes Javac on to compile it. Then, at a set time (e.g. specified on upload) I need to run that once on the server, which will generate some database info for the PHP site to display. To describe my current programming abilities- I have made many desktop Java programs, and am confident in 'pure' Java, but so far have only undertaken a couple of PHP projects (including using the CodeIgniter framework). My motivation for using PHP as the frontend is because I know it is very fast, lightweight and I will be able to display the results I need very easily with it (simple DB readout). Ideally, the technology used should be able to be developed on a localhost (e.g. WAMP, Tomcat etc..) Is there any advice which you could give on what technology I should consider to use to bridge this gap, and what resources could help in using that technology? I have looked at a few, but have struggled to find documentation helping in achieving what I need.

    Read the article

  • Write transparent HTTP Proxy script in PHP

    - by Leo Izen
    Is there an easy forwarding/transparent php proxy script that I can host on my web server? These are my conditions: I'm using free web hosting, so I have pretty much no control over my machine. Otherwise I could use Perl's HTTP::Proxy module. This means no root password. It does run php though. I already have a server running on port 80. What I mean is I would like to put a php script as index.php on my server that will forward all requests. I don't want a script like PHProxy or Glype where I go to the site, then enter a URL. I want a server so I can enter proxy.example.com:80 in Firefox's or IE's or whatever's proxy settings and it will forward all requests to the server. Preferably (though not fatal if not possible) I would like for it to pass on the USER_AGENT environmental variable (That's the browser) instead of setting itself to be the USER_AGENT I can't start a new Daemon. My server won't allow it. Is there a script that will do this? If so, which?

    Read the article

  • Pi help with Php (mass looping)

    - by Pieman
    My primary question is: Is this alot of loops? while ($decimals < 50000 and $remainder != "0") { $number = floor($remainder/$currentdivider); //Always round down! 10/3 =3, 10/7 = 1 $remainder = $remainder%$currentdivider; // 10%3 =1, 10%1 $thisnumber = $thisnumber . $number; $remainder = $remainder . 0; //10 $decimals += 1; } Or could I fit more into it? -without the server crashing/lagging. I'm just wondering, Also is there a more effiecent way of doing the above? (e.g. finidng out that 1/3 = 0.3 to 50,000 decimals.) Finally: I'm doing this for a pi formulae the (1 - 1/3 + 1/5 - 1/7 etc.) one, And i'm wondering if there is a better one. (In php) I have found one that finds pi to 2000 in 4 seconds. But thats not what I want. I want an infinite series that converges closer to Pi so every refresh, users can view it getting closer... see: http://zombiewrath.com/pi.php (Old one) and 'zombiewrath.com/superpi.php' (Newer one) But obv. converging using the above formulae takes ALONG time. Is there any other 'loop' like Pi formulaes (workable in php) that converge faster? Thanks alot...

    Read the article

  • PHP Fix Warning: Cannot modify header information - headers already sent...

    - by Storm Kiernan
    Warning: Cannot modify header information - headers already sent by (output started at /home/blocexco/public_html/homepage.php:73) in /home/blocexco/public_html/classes/mysql/mysql.security.php on line 99 This error is repeated a second time for mysql.security.php on line 100. homepage:73 <div class="login"> <?php require_once 'login.php'; ?> </div> mysql.security.php: 99-100 setcookie('username', "", time() - (60 * 60 * 24 * 365)); setcookie('password', "", time() - (60 * 60 * 24 * 365)); I know this isn't a "BOM" issue as I've read about. There is output before and after my calls to header() and setcookie() functions - this is necessary since the homepage includes a php file which then injects the right login or logout form. I've heard about using ob_start() at the beginning of content, but that's not a very specific instruction...I tried placing it at the beginning of homepage.php (just before the html tag) and that didn't fix anything. I'm new to PHP (a few days in, and new to web-app dev in general). To be honest, it blows my mind that I can't just change which page I am on, via php without bending over backwards...

    Read the article

  • Error while saving csv file generated by PHP

    - by user1667374
    I have created below script which is saving the csv file in the same path of this script but when I am saving it to different directory, it gives me error. Can somebody please help me on this? This is the error: Warning: fopen(/store/secure/mas/) [function.fopen]: failed to open stream: No such file or directory in /getdetails.php on line 15 Warning: fputs(): supplied argument is not a valid stream resource in /getdetails.php on line 36 Warning: fclose(): supplied argument is not a valid stream resource in /getdetails.php on line 39 This is the script: <?php $MYSQL_HOST="localhost"; $MYSQL_USERNAME="***"; $MYSQL_PASSWORD="***"; $MYSQL_DATABASE="shop"; $MYSQL_TABLE="ds_orders"; mysql_connect( "$MYSQL_HOST", "$MYSQL_USERNAME", "$MYSQL_PASSWORD" ) or die( mysql_error( ) ); mysql_select_db( "$MYSQL_DATABASE") or die( mysql_error( $conn ) ); $filename="Order_Details"; $directory = "/store/secure/mas/"; $csv_filename = $filename.".csv"; $fd = fopen ( "$directory" . $cvs_filename, "w"); $today="2009-03-17"; $disp_date="05122008"; $sql = "SELECT * FROM $MYSQL_TABLE where cDate='$today'"; $result=mysql_query($sql); $rows=mysql_num_rows($result); echo $rows; if(mysql_num_rows($result)>0){ $fileContent="Record ID,Discount Percent\n"; while($data=mysql_fetch_array($result)) { $fileContent.= "".$data['oID'].",".$data['discount']."\n"; } $fileContent=str_replace("\n\n","\n",$fileContent); fputs($fd, $fileContent); } fclose($fd); ?>

    Read the article

  • Ajax Code to run PHP query After Facebook Like Button is Clicked

    - by John
    I have the PHP below on a file called fblike.php. On another file, I have the Facebook Like button. The Like button functions. I would like to run the code below when the Facebook Like button is clicked. I know that FB.Event.subscribe('edge.create', function(response) {} is supposed to run whenever the Like button is clicked. I know that I am probably supposed to use Javascript and maybe Ajax to cause the PHP on fblike.php to run. But after multiple tries, I can't get it to work. What is the specific Ajax code that I could include within the Facebook Event? Do I need to do anything to the Like button code to allow the Facebook Event to work? $submissionid = $_POST['submissionid']; $uid = $_POST['uid']; mysql_connect("server", "username", "password") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $q = "INSERT INTO fblikes VALUES (NULL, '$submissionid', '$uid', NULL)"; $r = mysql_query($q); if($r) { echo "Success!"; } elseif(!$r) { echo "Failed!"; }

    Read the article

  • How would one dynamically load Javascript that has been parsed as PHP?

    - by beatsforthemind
    I am looking to dynamically load javascript that has been parsed as PHP so that I will be able to pass PHP variables to javascript, and then load this file into the primary PHP document. I have a document called myscript.js.php that includes the javascript and PHP. I attempted to load it into the primary document using jQuery's getScript like this: $.getScript("myscript.js.php", function() { alert('loaded script.'); }); This attempt failed - I am assuming because of the .php extension on the file. Is there anyway to dynamically load javascript that includes PHP? I have a few session variables that I am looking to pass through javascript that will be updated frequently, creating a need for the javascript to be reloaded.

    Read the article

  • Is ASP.NET MVC completely (and exclusively) based on conventions?

    - by Mike Valeriano
    --TL;DR Is there a "Hello World!" ASP.NET MVC tutorial out there that doesn't rely on conventions and "stock" projects? Is it even possible to take advantage of the technology without reusing the default file structure, and start from a single "hello_world.asp" file or something (like in PHP)? Am I completely mistaken and I should be looking somewhere else, maybe this? I'm interested in the MVC framework, not Web Forms --Background I've played a bit with PHP in the past, just for fun, and now I'm back to it since web development became relevant for me once again. I'm no professional, but I try to gain as much knowledge and control over the technology I'm working with as possible. I'm using Visual Studio 2012 for C# - my "desktop" language of choice - and since I got the Professional Edition from Dreamspark, the Web Development Tools are available, including ASP.NET MVC 4. I won't touch Web Forms, but the MVC Framework got my attention because the MVC pattern is something I can really relate to, since it provides the control I want but... not quite. Learning PHP was easy - and right form the start I could just create a "hello_world.php" file and just do something like this for immediate results: <!-- file: hello_world.php --> <?php> echo "Hello World!"; <?> But I couldn't find a single ASP.NET (MVC) tutorial out there (I'll be sure to buy one of the upcoming MVC 4 books, only a month away or so) that would start like that. They all start with a sample project, building up knowledge from the basics and heavily using conventions as they go along. Which is fine, I suppose, but it's now the best way for me to learn things. Even the "Empty" project template for a new ASP.NET MVC 4 Application in VS2012 is not empty at all: several files and folders are created for you - much like a new C# desktop application project, but with C# I can in fact start from scratch, creating the project structure myself. It is not the case with PHP: I can choose from a plethora of different MVC frameworks I can just create my own framework I can just skip frameworks altogether, and toss random PHP along with my HTML on a single file and make it work I understand the framework needs to establish some rules, but what if I just want to create a single page website with some C# logic behind it? Do I really need to create a whole bloat of files and folders for the sake of convention? Also, please understand that I haven't gotten far on any of those tutorials mainly because of this reason, but, if that's the only way to do it, I'll go for it using one of the books I've mentioned before. This is my first contact with ASP.NET but from the few comparisons I've read, I believe I should stay the hell away from Web Forms. Thank you. (Please forgive the broken English - it is not my primary language.)

    Read the article

  • Career Development: What should I learn next after Python? and Why? [closed]

    - by Josh
    Hi all I'm currently learning Python. I want to know what should I learn next out of these programming langauages: PHP Actionscript 3 Objective-C (iPhone applications) I work in the Multimedia industry and have decided to learn Python as a first programming language seriously because I would like to learn the basics of programming, to mainly write scripts at work that Automate task (eg. Edit multiple XML files quickly) At work we have a senior developer who knows Actionscript and PHP very well (although knows PHP better). We also have been developing iPhone applications for 2 weeks, Our senior developer could learn it although we have lots of work currently with PHP and Actionscript 3 type work and haven't had time or reason to pick up iOS development. Here are the reasons I want to learn each language, But I cannot decide what I'll learn next: PHP: I want to learn PHP because it will help with Web Development. PHP is very wanted by employers. Senior developer at work writes everything in it web sites, CMS etc. (including XML checks and scripts), I will learn a lot from him (once I learn the basics). However, I don't want to learn Web because you have to deal with lots of cross-browser problems. Actionscript 3: At work we are looking to put on another developer to help with online activities and very small games (using Actionscript 3.0 and Flash CS5) for (eg. First Aid Activities etc) I would like to do things that have a element of design as I'm better at Photoshop then developing. I want to be creative, I like to interact with users in a fun way. Objective-C (iPhone applications): We are a all mac office, we may get more iPhone, iPad application work(jobs) that need to be created. Work has found it nearly impossible to find good iPhone developers. I like apple products (Macs and iPhones), I would like to make my own games, applications in my spare time(if I knew how). Should I learn Actionscript first because it would be easier to learn then Objective-C? Should I learn PHP because it is very widely used? Should I learn Objective-C because it is really wanted by employers now?

    Read the article

  • Need help debugging a very basic PHP SOAP Hello world app

    - by WarDoGG
    I have been breaking my head at this, reading almost every article and tutorial there is on the web, but nothing doing.. i still cannot get my first web service application to work. I would really appreciate it if anyone could debug this code for me and provide me with a good explanation as to what is wrong and why. This will help indeed ! Thanks ! I have pasted below the entire codes that i am using making it easier to debug. I'm using the PHP5 SOAP extension. Here is my WSDL: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions name="testWebservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:import namespace="http://microsoft.com/wsdl/types/" /> <s:element name="getUser"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="getUserResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="getUserResult" type="tns:userInfo" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="userInfo"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="authkey" type="s:int" /> </s:sequence> </s:complexType> </s:schema> </wsdl:types> <wsdl:message name="getUserSoapIn"> <wsdl:part name="parameters" element="tns:getUser" /> </wsdl:message> <wsdl:message name="getUserSoapOut"> <wsdl:part name="parameters" element="tns:getUserResponse" /> </wsdl:message> <wsdl:portType name="testWebservice"> <wsdl:operation name="getUser"> <wsdl:input message="tns:getUserSoapIn" /> <wsdl:output message="tns:getUserSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="testWebserviceBinding" type="tns:testWebservice"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getUser"> <soap:operation soapAction="http://tempuri.org/getUser" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="testWebserviceService"> <wsdl:port name="testWebservicePort" binding="tns:testWebserviceBinding"> <soap:address location="http://127.0.0.1/nusoap/storytruck/index.php" /> </wsdl:port> </wsdl:service> </wsdl:definitions> and here is the PHP Code i use to setup the server: <?php function getUser($user,$pass) { return array('ID'=>1); } ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache $server = new SoapServer("http://127.0.0.1/mywsdl.wsdl"); $server->addFunction('getUser'); $server->handle(); ?> and the code for the client: <?php $client = new SoapClient("http://127.0.0.1/index.php?wsdl", array('exceptions' => 0)); try { $result = $client->getUser("username","pass"); print_r($result); } catch (SoapFault $result) { print_r($result); } ?> Here is the ERROR output i am getting on the browser : SoapFault Object ( [message:protected] => Error cannot find parameter [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\xampp\htdocs\client.php [line:protected] => 6 [trace:Exception:private] => Array ( [0] => Array ( [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => getUser [1] => Array ( [0] => username [1] => pass ) ) ) [1] => Array ( [file] => C:\xampp\htdocs\client.php [line] => 6 [function] => getUser [class] => SoapClient [type] => -> [args] => Array ( [0] => username [1] => pass ) ) ) [previous:Exception:private] => [faultstring] => Error cannot find parameter [faultcode] => SOAP-ENV:Client )

    Read the article

  • PHP - Store & Calculate the total mark from radio input

    - by user1806136
    I have designed a small web-based system that have a school evaluation form to ask specific users who can access the system" some questions and the input will be a radio type ( 1 or 2 or 3 or 4)! the code is working and can inserts the input into the database but i don't know the correct query to calculate the total mark and store it in the database, this is currently working code below: <?php session_start(); $Load=$_SESSION['login_user']; include('../connect.php'); $sql= "Select name from student where ID='$Load'"; $username = mysql_query($sql); $id=$_SESSION['login_user']; if (isset($_POST['submit'])) { $v1 = $_POST['v1']; $v2 = $_POST['v2']; $v3 = $_POST['v3']; $total = $_POST['total']; mysql_query("INSERT into Form1 (P1,P2,P3,TOTAL) values('$v1','$v2','$v3','$total')") or die(mysql_error()); header("Location: mark.php"); } ?> <html> <head> <?php if(!isset($_SESSION['login_user'])) header("Location:index.html"); ?> <title>Q&A Form</title> </head> <body> <center><form method="post" action="" > <table style="width: 20%" > <tr> <th> Criteria </th> <th> </th> </tr> <tr> <th> Excellent </th> <td > 4 </td> </tr> <tr> <th > Good <font size="3" > </font></th> <td> 3 <font size="4" > </font></td> </tr> <tr> <th > Average <font size="3" > </font></th> <td > 2 <font size="4" > </font></td> </tr> <tr> <th > Poor <font size="3" > </font></th> <td > 1 <font size="4" > </td> </tr> <font size='4'> <table style="width: 70%"> <tr> <th > School Evaluation <font size="4" > </font></th> <tr> <th > Criteria <font size="4" > </font></th> <th> 4<font size="4" > </font></th> <th> 3<font size="4" > </font></th> <th> 2<font size="4" > </font></th> <th> 1<font size="4" > </font></th> </tr> <tr> <th> Your attendance<font size="4" > </font></th> <td> <input type="radio" name ="v1" value = "4" checked = "checked" /></td> <td> <input type="radio" name ="v1" value = "3" /></td> <td> <input type="radio" name ="v1" value = "2" /></td> <td> <input type="radio" name ="v1" value = "1" /></td> </tr> <tr> <th > Your grades <font size="4" > </font></th> <td> <input type="radio" name ="v2" value = "4" checked = "checked" /></td> <td> <input type="radio" name ="v2" value = "3" /></td> <td> <input type="radio" name ="v2" value = "2" /></td> <td> <input type="radio" name ="v2" value = "1" /></td> </tr> <tr> <th >Your self-control <font size="4" > </font></th> <td> <input type="radio" name ="v3" value = "4" checked = "checked" /></td> <td> <input type="radio" name ="v3" value = "3" /></td> <td> <input type="radio" name ="v3" value = "2" /></td> <td> <input type="radio" name ="v3" value = "1" /></td> </tr> </tr> </table> <br> <a href="evaE.php"> <td><input type="submit" name="submit" value="Submit"> <input type="reset" name="clear" value="clear" style="width: 70px"></td> <?php $total = $v1+ $v2 + $v3; ?> </form> </center> </div> </body> </html> i used this query but it doesn't work out .. any help please? <?php $total = $v1+ $v2 + $v3; ?>

    Read the article

  • PHP Using session variables in array(s)

    - by Chris
    Hello, My question is how do i put these session variables into a array? I have tried countless ways but none of them work. Not really sure what to put in a array and what no and how to adress them. Currently when i fill in the form the data gets displayed in a table. Next when i press the hyperlink that takes me back to the same form, i wish to enter data again. This data should be added in a new row in the same display table. Best Regards. The code below (pardon me that it is not english). <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ExpoFormulier</title> <body> <?php if (!empty($_POST)) { $standnaam = $_POST["standnaam"]; $oppervlakte = $_POST["oppervlakte"]; //value in the form van checkboxes op 1 zetten! $verdieping = isset($_POST["verdieping"]) ? $_POST["verdieping"] : 0; $telefoon = isset($_POST["telefoon"]) ? $_POST["telefoon"] : 0; $netwerk = isset($_POST["netwerk"]) ? $_POST["netwerk"] : 0; if (is_numeric($oppervlakte)) { $_SESSION["standnaam"]=$standnaam; $_SESSION["oppervlakte"]=$oppervlakte; $_SESSION["verdieping"]=$verdieping; $_SESSION["telefoon"]=$telefoon; $_SESSION["netwerk"]=$netwerk; header("Location:ExpoOverzicht.php"); } else { echo "<h1>Foute gegevens, Opnieuw invullen a.u.b</h1>"; } } ?> <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" id="form1"> <h1>Vul de gegevens in</h1> <table> <tr> <td>Standnaam:</td> <td><input type="text" name="standnaam" size="18"/></td> </tr> <tr> <td>Oppervlakte (in m^2):</td> <td><input type="text" name="oppervlakte" size="6"/></td> </tr> <tr> <td>Verdieping:</td> <td><input type="checkbox" name="verdieping" value="1"/></td> </tr> <tr> <td>Telefoon:</td> <td><input type="checkbox" name="telefoon" value="1"/></td> </tr> <tr> <td>Netwerk:</td> <td><input type="checkbox" name="netwerk" value="1"/></td> </tr> <tr> <td><input type="submit" name="verzenden" value="Verzenden"/></td> </tr> </table> </form> Second File: <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ExpoOverzicht</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link href="StyleSheetExpo.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>Overzicht van de ingegeven standen in deze sessie</h1> <?php $standnaam = $_SESSION["standnaam"]; $oppervlakte = $_SESSION["oppervlakte"]; $verdieping = $_SESSION["verdieping"]; $telefoon = $_SESSION["telefoon"]; $netwerk = $_SESSION["netwerk"]; $result1 = 0; $result2 = 0; $result3 = 0; $prijsCom = 0; $prijsVerdieping = 0; for ($i=1; $i <= $oppervlakte; $i++) { if($i <= 10) { $tarief1 = 1 * 100; $result1 += $tarief1; } if($i > 10 && $i <= 30) { $tarief2 = 1 * 90; $result2 += $tarief2; } if($i > 30) { $tarief3 = 1 * 80; $result3 += $tarief3; } } $prijsOpp = $result1 + $result2 + $result3; if($verdieping == 1) { $prijsVerdieping = $oppervlakte * 120; } if(($telefoon == 1) || ($netwerk == 1)) { $prijsCom = 20; } if(($telefoon == 1) && ($netwerk == 1)) { $prijsCom = 30; } $totalePrijs = $prijsOpp + $prijsVerdieping + $prijsCom; echo "<table class=\"tableExpo\">"; echo "<th>Standnaam</th>"; echo "<th>Oppervlakte</th>"; echo "<th>Verdieping</th>"; echo "<th>Telefoon</th>"; echo "<th>Netwerk</th>"; echo "<th>Totale prijs</th>"; echo "<tr>"; echo "<td>".$standnaam."</td>"; echo "<td>".$oppervlakte."</td>"; echo "<td>".$verdieping."</td>"; echo "<td>".$telefoon."</td>"; echo "<td>".$netwerk."</td>"; echo "<td>".$totalePrijs."</td>"; echo "</tr>"; echo "</table>"; ?> <a href="ExpoFormulier.php">Terug naar het formulier</a> </body> </html> </body> </html>

    Read the article

  • Increase php session time via .htaccess not working

    - by Ken
    I want to create the session timeout to 6 hours but my browser is still timing out in 1/2 hour. I am on a PLESK server. I updated .htaccess php_value session.gc_maxlifetime 21600 php_value session.cache_expire 21600 php_value session.cookie_lifetime 21600 Here is the relevant PHPinfo: Local Master session.gc_maxlifetime 21600 1440 session.cache_expire 21600 180 session.gc_maxlifetime 21600 1440

    Read the article

  • load a php page with a cron job

    - by s2xi
    I am using a cron job to reload my httpd service after a subdomain is created. I have the problem that when the reload happens the page that registers the user throws a server error. I was wondering if I could go around this by having another cron task. So my logic would be: httpd reload after a .conf file is created then take the user back to the DocumentRoot of the main page. So in usage it would be: a user registers, then is automatically taken back to domain.com

    Read the article

  • Setup site folders on Apache and PHP

    - by Cobus Kruger
    I'm trying to set up my first Apache server on my Windows PC at home and I have real trouble finding out which configuration settings go where. I downloaded and installed XAMPP which seemed to get everything nicely set up and can see a working website on http://localhost. So far so good. The point of this is to develop a website of course, and to make my life easier (irony?), I wanted to let the web site root point to my Eclipse project folder. So I opened httpd-vhosts.conf, uncommented a VirtualHost block and changed its DocumentRoot to my local path. Now when I try to load http://localhost I get a 403 (Access denied) error. So where do I configure permissions for my folder? And is that all I need to let my site run from the folder specified or am I going to have to clear another hurdle? Update: I tried to simplify things a little, so I reinstalled XAMPP and got back to a working http://localhost. Then I confirmed that httpd-vhosts.conf is included in httpd.conf and made the following changes to httpd-vhosts.conf: Uncommented the line NameVirtualHost *:80 Added a virtual host shown below. Restarted Apache and saw the expected page on http://localhost <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/" ServerName localhost ErrorLog "logs/dummy-host2.localhost-error.log" CustomLog "logs/dummy-host2.localhost-access.log" combined </VirtualHost> I then created a new folder named C:\testweb, added an index.html file and changed the DocumentRoot line shown above. For all intents and purposes I would then expect the two configurations to be equivalent. But this setup gives me an error 403. Even though the C:\testweb folder already had the same permissions as the C:\xampp\htdocs folder, I then went further and gave the Everyone group full control of C:\testweb and got exactly the same problem. So what did I miss?

    Read the article

  • http compression shared hosting apache/php

    - by gansodesoya
    Hi, I was sniffing the response header of one my sites and apparently is not using http compression to deliver responses because I'm not seeing the Content-Encoding: gzip in the response header. But the weird thing is that phpinfo() shows me HTTP_ACCEPT_ENCODING: gzip,deflate,sdch Im using a rackspace cloud site (shared hosting, cant access httpdconfig), and I really want to activate http compression but the support guys over there tells me that if the phpinfo() says it, its already on. thanks.!

    Read the article

  • I am unable to run a client/server program in php

    - by sibi
    This is the program I am trying to run: $host = "127.0.0.1"; $port = 25003; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); // bind socket to port $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n"); // start listening for connections $result = socket_listen($socket, 3) or die("Could not set up socket listener\n"); // accept incoming connections // spawn another socket to handle communication $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); // read client input $input = socket_read($spawn, 1024) or die("Could not read input\n"); // clean up input string $input = trim($input); echo "Client Message : ".$input; // reverse client input and send back $output = strrev($input) . "\n"; socket_write($spawn, $output, strlen ($output)) or die("Could not write output\n"); // close sockets socket_close($spawn); socket_close($socket); I enabled the PHP_socket option in WAMP but still I keep getting errors like unable to bind. Can someone please help me out?

    Read the article

  • best practice with memcache/php - multi memcache nodes

    - by user62835
    So I am working on a web app - that has to be built for scalability. It stores frequent MySQL querys into the cache. I have pretty much everything built and ready to go - but I am concerned on best practices on handling where to cache the data. I've talked to a few people and one of them suggested to split each key/value across all the memcache nodes. Meaning if i store the example: 'somekey','this is the value' it will be split across lets say 3 memcache servers. Is that a better way? or is memcache more built on a 1 to 1 relationship?. For example. store value on server A till it faults out - go to server B and store there. that is my current understanding from the research I have done and past experience working with memcache. Could someone please point me in the right direction in this and let me know which way is best or if I completely have this mixxed up. Thanks

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >