PHP - Turn Off Notices
How to turn off notices in PHP 5.3.
Is it possible to turn it off in php.ini? Similar TutorialsSo if I have this code (while working on my local machine )... Code: [Select] for ($i=1; $i<=15; $i++) { if ($timelimit == $i) { ${"time".$i}="selected='selected'"; } } <select name="timelimit"> <option value="1" <?php echo $time1;?>>1</option> <option value="2" <?php echo $time2;?>>2</option> <option value="3" <?php echo $time3;?>>3</option> <option value="4" <?php echo $time4;?>>4</option> <option value="5" <?php echo $time5;?>>5</option> <option value="6" <?php echo $time6;?>>6</option> <option value="7" <?php echo $time7;?>>7</option> <option value="8" <?php echo $time8;?>>8</option> <option value="9" <?php echo $time9;?>>9</option> <option value="10" <?php echo $time10;?>>10</option> <option value="11" <?php echo $time11;?>>11</option> <option value="12" <?php echo $time12;?>>12</option> <option value="13" <?php echo $time13;?>>13</option> <option value="14" <?php echo $time14;?>>14</option> <option value="15" <?php echo $time15;?>>15</option> </select> When I view the select menu in the browser, all but one of the options says "Notice: Undefined variable: time1 in C:\wamp\www\yyyyyy\create.php on line 112". It doesn't say this if I publish everything to the internet. So the question is, should I put code in to eliminate those Notices, or does it not matter. In other words, if I add this snippet below to declare all the other variables, it eliminates all the Notices. But is this necessary/good practice to do?.. Code: [Select] for ($i=1; $i<=15; $i++) { ${"time".$i}=""; } Hello, I have just upgraded my wampserver and with it MySQL, PHP and PhpMyAdmin versions. And my scripts, which ran normally before, not burst hundreds of undefined variable and undefined index notices. I realize it's "notices", not "errors" but this is quite irritating. I believe it might be due to some upgrade in PHP scripting rules or something but I don't know what. I hope you can help me. The first type of notice is "undefined variable". This function will return the notice if I remove the bold red line, where I define the variable as empty before I use it in the loop. I didn't need to do this before. function statistics($array) { [color=red][b]$list = '';[/b][/color] if(is_array($array)) { foreach($array as $name => $value) { // Rip out the name of the client. $list .= "<li>".$name." - "; // set an integer so we know how many tier2 values we have read. $x = 0; foreach($value as $difference => $sum_total) { // if this is the more than the first tier2 values, use a '+' between the units. $list .= (++$x > 1) ? " + ".$sum_total." ".$difference : $sum_total." ".$difference; } // close the line out. $list .= "</li>"; } } return $list; } To avoid the 10+ like notices on the page I declare them empty before the variable's first occurrence. But this sounds stupid to me. Wasn't this one of PHP's benefits, not to have to declare the variable before using it? I also get about 30+ undefined index notices, e.g. Quote Notice: Undefined index: COMPANY XXX in F:\wamp\www\Project Management\main.php on line 37 Notice: Undefined index: USD in F:\wamp\www\Project Management\main.php on line 37 Notice: Undefined index: USD in F:\wamp\www\Project Management\main.php on line 41 Here are those lines: $income_total = calculate("income"); foreach($income_total as $row) { $clientID = $row['clientID']; $clientname = $row['clientname']; //$client = "<a href=\"index.php?page=Client&do=view&clientID=$clientID\">".$clientname."</a>"; $client = "<a href=\"index.php?page=Project&do=view&sortby=$clientID\">".$clientname."</a>"; $currency = $row['currency']; $client_sum = $row['client_sum']; $year_sum = ''; $year_sum += $client_sum; $income = ''; $income[$client][$currency] += $client_sum; $income_list = statistics($income); $income_all = ''; $income_all[$currency] += $client_sum; } Line 37 is: Quote $income[$client][$currency] = It's the values assigned to $client and to $currency that seem to cause the notice. How do I deal with this? I don't just want to turn error/notice display off, I want to resolve this issue. Hi. I have made profile pages available for users.. How do I turn off <?php ?> for those pages? I would like javascript enabled however. All suggestions are welcome!! Thanks How do I turn a checkbox on or off programatically? My form has several checkboxes that are grouped together and I want them to be turned on initially when the user first sees the form.I can do that very easily by just including "checked" in the HTML for the checkbox. But if the user turns off the checkbox before he presses Submit, I want to make sure I show the ones that are off as off when I redisplay the form as a result of errors in other fields, like textareas. How do I turn the checkbox off or on within my PHP code? Edited June 9, 2019 by HenryCanI've tried to use this http://www.bambalam.se/bamcompile/ .. but I cant get curl to work using the option to set the extension.. I need it to be able to sign into myspace or facebook with curl when it is in an exe.. everything else works fine with bambalam, everything but curl and connecting to an mysql db, I dont need to have mysql support, only curl.. what would be the easiest way to make this happen? btw the exe should just open a CLI and run the script, thanks Hi, How would I do this, I'm trying to create a function to turn the octal (not sure whats its called exactly) input into its numberic representation, like so: <?php function octal_to_number($input) { //do something... return $number; } //would turn 0x17c into 380... echo octal_to_number('0x17c'); ?> Hello All, I'm trying to put a lot of what I do into function calls now to make my code a bit tidier and consise. Take this simple if statement: if ($_GET['thedate'] =='') { $var = date('l, jS F, Y',time()); } else { $var = date('l, jS F, Y', strtotime($_GET['thedate'])); } How could I put this into a function and in some kind of switch statement? Thanks I've tried to find an answer in the forum and although there have been posts similar I am unable to covert the answer to fit what I've got (mostly because I know very very little about php - sorry). What I need is one of the results to be added to the end of a url in order to create a link. Basically I have a storefront (www.storefront.com/) and the result NAME can be added onto the end of our url to create a link to the product page. (www.storefront.com/NAME) Code: [Select] <?php $dbhost = ""; $dbuser = ""; $dbpass = ""; $dbname = ""; //Connect to MySQL Server mysql_connect($dbhost, $dbuser, $dbpass); //Select Database mysql_select_db($dbname) or die(mysql_error()); // Retrieve data from Query String $price = $_GET['price']; $taxable = $_GET['taxable']; $weight = $_GET['weight']; // Escape User Input to help prevent SQL Injection $age = mysql_real_escape_string($price); $sex = mysql_real_escape_string($taxable); $wpm = mysql_real_escape_string($weight); //build query $query = "SELECT * FROM Products WHERE taxable = '$taxable'"; if(is_numeric($price)) $query .= " AND price <= $price"; if(is_numeric($weight)) $query .= " AND weight <= $weight"; //Execute query $qry_result = mysql_query($query) or die(mysql_error()); //Build Result String $display_string = "<table>"; $display_string .= "<tr>"; $display_string .= "<th>Name</th>"; $display_string .= "<th>Price</th>"; $display_string .= "<th>Taxable</th>"; $display_string .= "<th>Weight</th>"; $display_string .= "</tr>"; // Insert a new row in the table for each person returned while($row = mysql_fetch_array($qry_result)){ $display_string .= "<tr>"; $display_string .= "<td>'<a href="www.storefront.com/">' . $row[name] . ' </a>'/td>"; $display_string .= "<td>$row[price]</td>"; $display_string .= "<td>$row[taxable]</td>"; $display_string .= "<td>$row[weight]</td>"; $display_string .= "</tr>"; } echo "Query: " . $query . "<br />"; $display_string .= "</table>"; echo $display_string; ?> I know the way it is setup in the code is wrong. Can anyone help me out? Would really appreciate it. Thanks - and again, sorry for my lack of php knowledge. Hi. I have a problem with output buffering. I'm using wamp. I've tried setting the php.ini file to output_buffering = 0 and off I've tried using flush() and ob_flush(), separetly and together. I've tried turning on implicit_flush. Nothing works. Any ideas? I'm using the flowing code to test right now: Code: [Select] echo 'starting...<br/>'; for($i = 0; $i < 5; $i++) { print "$i<br/>"; flush(); sleep(2); } print 'DONE!<br/>'; i have apache 2.2 and php 5.0 installed on my pc, i have a html page and i need to turn it into php and also i need to include a header and a footer, i tryed doing it but the webpage won't display, what am i doing wrong? here is my page which i tryed turning into php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!--index.html is basically an introductory page to this website, this page introduce us to this website. This page tell us, this page is called index.html because that's the name of the first page on any website, this page tell us wat type of website this is, name of this website, name of the person(in this case that's me) who made it, a light description of what type of contents we will find inside this website etc. This page tell us the name of this lab assignment which is " --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>INTN2201 - Lab 1</title><!--title of this page --> <link href="./css/intn2201.css" rel="stylesheet" type="text/css" /></head> <body> <table border="1" > <tr> <td class="navmenu"><img src="images/my_logo.jpg" alt="My Logo" /></td> <td class="page_header"><h1>INTN 2201: Lab Assignment 1: HTML Pages</h1></td> </tr> <tr> <td valign="top"> <a href="index.html" >MY HOME PAGE</a> <br /> <a href="lab1.html" >LAB 1:HTML Intro</a> <br /> <a href="lab2.html" >LAB 2:HTML Tables</a> <br /> <a href="lab3.html" >LAB 3:CSS Styles</a> </td> <td class="main_body"><h2> Purpose of this website</h2> <p class="p1"> This website was created for first lab assignment of <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a>, <a href="http://opentech.durhamcollege.ca/~pufferd/intn2201">INTN2201</a> is the course code for "INTERNET DEVELOPMENT I" course, at <a href="http://www.durhamcollege.ca">Durham College</a> every first year student<br/> of Computer System Technology program(3 years) have to take this course, main purpose of this site is to get a first feel for creating a basic html website<br/> but also to get a feel of how to use it in website creation, during the creation of this page i get to know programs like notepad++,<br/> WINSCP, learned how to login to course webserver(opentech.durhamcollege.ca), another purpose for this site is to test webpage creator's( in this case that's me)<br/> knowledle about HTML tags, XHTML, W3C validator, HTML stands for Hyper Text,it is not a programming language it is a Markup Language,<br/> I(creater of this website) wanted to learn about differen't html tags and one of the best ways to learn about html tags is to try create<br/> a html webpage. </p> <hr/> <h2>ol { margin-left : 200px; } </h2> <p class="p2"> in this style tag i used Margine properties to define a list in lab2.html, bottom of the page u will see lists, so margine basically sets all the margin properties in one declaration.</p> <hr/> <a href="http://www.durhamcollege.ca/"> <img width="300" src="images/durham_college_logo.jpg" alt="My Logo" /></a> <hr/> </td> </tr> <tr> <td class="navmenu" colspan="2" align="right"> ©2011 <p> <a href="http://validator.w3.org/check?uri=referer"> <img style="width:88px; height:31px; position:fixed; bottom: 81px; left:50px;" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" /> </a> </p> <p> <a href="http://jigsaw.w3.org/css-validator/check/referer"> <img style="width:88px; height:31px; position:fixed; bottom: 45px; left:50px; " src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p></td> </tr> </table> </body> </html> how do i turn this into php page and what goes in the header and footer? I think my eyes are going to fall out from all the searches ive made to find a solution for this that works on a shared host.
I tried this... but it doesnt work.
RewriteEngine on CheckSpelling onThe only Rough solution i got is to do the case manually with an internal redirect. Like this. RewriteEngine on RewriteBase /~quux/ RewriteRule ^foo\.html$ bar.htmlIs there absolutely no way to mention [a-z] and [A-Z] into a RewriteRule to get this done? I find it terribly stupid from Apache not to provide a simple solution for this. Hi all, I'm recent working on my php to extract some data from mysql database. Is it possible to output the database data into <a href> turn to the hyperlink instead of using http://mysite.freesite.com/mydatalink.com to this http://mydatalink.com? The script I have made so far is doing something wrong and I can't be able to find the solution. here's the current code: <?php session_start(); define('DB_HOST', 'localhost'); define('DB_USER', 'mydbuser'); define('DB_PASSWORD', 'mydbpass'); define('DB_DATABASE', 'mydbname'); $errmsg_arr = array(); $errflag = false; $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } function clean($var) { return mysql_real_escape_string(strip_tags($var)); } $username = clean($_GET['user']); if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; echo implode('<br />', $errmsg_arr); } else { $insert = array(); if(isset($_GET['user'])) { $insert[] = 'username = \'' . clean($_GET['user']) .'\''; } if (count($insert)>0) { $names = implode(',',$insert); if($username) { $qrytable1="SELECT id, links FROM mydatalist WHERE username='$username'"; $result1=mysql_query($qrytable1) or die('Error:<br />' . $qry . '<br />' . mysql_error()); while ($row = mysql_fetch_array($result1)) { echo '<p id="images"> <a href="images.php?id='.$row['id'].'">Images</a></td> | <a href="' . $row["links"] . '">Link</a> </td>'; } } } } ?> I don't want to adding an <a href> into the first echo statement, because I am stored the links in the database which you can see that I am using ['links']. I need to ouput the data from the db to turn into hyperlink. If anyone could assist with this I'd be very grateful! Thanks, Mark My web host wont turn on Curl.dll is there any other way to do this with out using Curl #---------------------------------------------------------------------------- # Curl code to store XML data from PWA in a variable #---------------------------------------------------------------------------- $ch = curl_init(); $timeout = 0; // set to zero for no timeout curl_setopt($ch, CURLOPT_URL, $file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: AuthSub token="' . $GDATA_TOKEN . '"' )); $addressData = curl_exec($ch); curl_close($ch); hello i keep seeing Ternary Operators like this Code: [Select] $action = (empty($_POST['action'])) ? 'default' : $_POST['action']; but how would i turn this if statement in to a Ternary Operator ? Code: [Select] if($a == $b){ echo 'hello'; }else{ //do nothing } thanks I am trying to use a Wordpress module called WooCommerce PDF Invoices to make event tickets by modifying the layout of the invoice to create an online ticket to printout. I've successful reformatted the layout and it works like a charm except for one thing. The problem I have is that no matter what is bought the invoice reads "This is a ticket" which I hardcoded into the invoice design. What I would like is an if/then statement inserted into the invoice design that will print between "This is a ticket" or "This is a receipt" depending on if they purchase one of the 4 ticket items. "This is a recept" If ticket 1 then print "This is a ticket" else print "This is a receipt. If ticket 2 then print "This is a ticket" else print "This is a receipt. If ticket 3 then print "This is a ticket" else print "This is a receipt. If ticket 4 then print "This is a ticket" all else print "This is a receipt." I completely redesigned the woocommerce pdf invoice to look like an online ticket. The first half looks like an actual ticket. <?php global $wpo_wcpdf; ?> <table align="center" cellpadding="0" cellspacing="0" class="pdfbackground" style="width: 700px; height: 350px"> <tr> <td style="width: 20px"> </td> <td style="width: 285px"> </td> <td style="width: 300px"> </td> <td style="width: 75px"> </td> <td style="width: 20px"> </td> </tr> <tr> <td rowspan="4" style="width: 20px"> </td> <td class="pdflogo" rowspan="4" style="width: 285px"><br /><div id="container"><div><?php if( $wpo_wcpdf->get_header_logo_id() ) { $wpo_wcpdf->header_logo(); } else { _e( 'Ticket', 'wpo_wcpdf' ); } ?></div><div class="order-information"> <br /><br /><hr width=50% color=#0087E1><?php $date_setting = isset($wpo_wcpdf->settings->template_settings['display_date'])?$wpo_wcpdf->settings->template_settings['display_date']:'order_date'; $number_setting = isset($wpo_wcpdf->settings->template_settings['display_number'])?$wpo_wcpdf->settings->template_settings['display_number']:'order_number'; // set $display date & label to user setting if ( $date_setting == 'invoice_date' ) { $display_date = $wpo_wcpdf->get_invoice_date(); $display_date_label = __( 'Event Date:', 'wpo_wcpdf' ); } else { $display_date = $wpo_wcpdf->get_order_date(); $display_date_label = __( 'Order Date:', 'wpo_wcpdf' ); } // set $display number & label to user setting if ( $number_setting == 'invoice_number' ) { $display_number = $wpo_wcpdf->get_invoice_number(); $display_number_label = __( 'Transaction Number:', 'wpo_wcpdf' ); } else { $display_number = $wpo_wcpdf->get_order_number(); $display_number_label = __( 'Order Number:', 'wpo_wcpdf' ); } ?> <span class="order-date-label"><?php echo $display_date_label; ?></span> <span class="order-date"><?php echo $display_date; ?></span><br /> <span class="order-number-label"><?php echo $display_number_label; ?></span> <span class="order-number"><?php echo $display_number; ?></span><br /> <br /> <br /> </div></div></td> <td style="width: 300px"><div class="shop-name"><h3><?php $wpo_wcpdf->shop_name(); ?></h3><br /> SPONSORED BY: <br />SPONSOR 1 LOGO | SPONSOR 2 LOGO </div> </td> <td rowspan="4" style="width: 75"><br /><br /><br /><br /><br /><br /> <img alt="" height="126" src="http://www.3corlando.com/wp-content/uploads/2014/06/barcode.png" width="71" class="barcode" /></td> <td rowspan="4" style="width: 20px"> </td> </tr> <tr> <td style="width: 300px"><hr width=75% color=#0087E1><div class="shop-address"><?php $wpo_wcpdf->shop_address(); ?></div> </td> </tr> <tr> <td style="width: 300px"> </td> </tr> <tr> <td style="width: 300px"></td> </tr> <tr> <td class="pdfborder" style="width: 20px"> </td> <td class="pdfticket" colspan="3"><div class="pdfticket"><hr width=50% color=#0087E1>***This is a Receipt*** </div> </td> <td class="pdfborder" style="width: 20px"> </td> </tr> </table>And the second half looks like an invoice. <!-- head container --> <hr> <table class="order-details"> <thead> <tr> <th class="product-label"><?php _e('Shop Items', 'wpo_wcpdf'); ?></th> <th class="quantity-label"><?php _e('Quantity', 'wpo_wcpdf'); ?></th> <th class="price-label"><?php _e('Price', 'wpo_wcpdf'); ?></th> </tr> </thead> <tbody> <?php $items = $wpo_wcpdf->get_order_items(); if( sizeof( $items ) > 0 ) : foreach( $items as $item ) : ?><tr> <td class="description"> <?php $description_label = __( 'Description', 'wpo_wcpdf' ); // registering alternate label translation ?> <span class="item-name"><?php echo $item['name']; ?></span><span class="item-meta"><?php echo $item['meta']; ?></span> <dl class="meta"> <?php if( !empty( $item['sku'] ) ) : ?><dt><?php _e( 'SKU:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['sku']; ?></dd><?php endif; ?> <?php if( !empty( $item['weight'] ) ) : ?><dt><?php _e( 'Weight:', 'wpo_wcpdf' ); ?></dt><dd><?php echo $item['weight']; ?><?php echo get_option('woocommerce_weight_unit'); ?></dd><?php endif; ?> </dl> </td> <td class="quantity"><?php echo $item['quantity']; ?></td> <td class="price"><?php echo $item['order_price']; ?></td> </tr><?php endforeach; endif; ?> </tbody> <tfoot> <tr class="no-borders"> <td class="no-borders" colspan="3"> <table class="totals"> <tfoot> <?php foreach( $wpo_wcpdf->get_woocommerce_totals() as $total ) : ?> <tr> <td class="no-borders"> </td> <th class="description"><?php echo $total['label']; ?></th> <td class="price"><span class="totals-price"><?php echo $total['value']; ?></span></td> </tr> <?php endforeach; ?> </tfoot> </table> </td> </tr> </tfoot> </table><!-- order-details --> <table class="notes container"> <tr> <td colspan="3"> <div class="notes-shipping"> <?php if ( $wpo_wcpdf->get_shipping_notes() ) : ?> <h3><?php _e( 'Customer Notes', 'wpo_wcpdf' ); ?></h3> <?php $wpo_wcpdf->shipping_notes(); ?> <?php endif; ?> </div> </td> </tr> </table><!-- notes container --> <?php if ( $wpo_wcpdf->get_footer() ): ?> <div id="footer"> <?php $wpo_wcpdf->footer(); ?> </div><!-- #letter-footer --> <?php endif; ?>I want to identify one of my 4 ticket items that may appear where the invoice prints the items and when one of them does appear it changes "This is a receipt" to "This is a ticket" in the first half. Is something like this possible? If so, can anyone give me a direction to find the coding for this? Can anybody give me an idea how to write this in php. I'm a pro at html but I've only taught myself how to modify existing php coding. I can't write it from scratch. Any help is appreciated. This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=347224.0 Say I have a chunk of code that looks like this (contains imagesx): Code: [Select] <span style="color: #0000BB">$width </span><span style="color: #007700">= </span><span style="color: #0000BB">imagesx</span><span style="color: #007700">(</span><span style="color: #0000BB">$img</span><span style="color: #007700">); <br /> within the code I would like to make all the php functions link to php.net I thought that the following code would work, but it does not, well because there is no spaces around the above word public function phpLinks($string){ $words = explode(" ", $string); $str = array(); foreach($words as $word){ if(function_exists($word)){ $str[] = preg_replace("/$word/i", '<a href="//php.net/'.strtolower($word).'">'.$word.'</a>', $word); }else{ $str[] = $word; } } return implode(" ", $str); } I now can not think of a good way to do this, so I am asking does anyone have any suggestions? How do you turn off a php form after a set number of submissions? My form is not hooked up to a mysql database. Theoretically I think I would need to set something up that increments a number with each successful form submission. Then when the form hits a certain limit number like 300 it shuts off or hides the div that contains the form. Has anyone done something like this before? Any help or even just pointing me in the right direction is greately appreciated! Hi folks, If thought i finally managed to make a 2 player game with PHP and Jquery but i my whole computer gets stucked when the first player has gets his 2nd turn. What i basically have are 2 .txt files where both players units are listed. I will read this file into an array. Each unit has a speed key wich value increases when that unit has made an action, i write the new speed to the file and the script runs again. Heres the script that decides which unit goes first. Code: [Select] $time = 0; $found = 0; while ($found != 1) { foreach ($P1recruit as $p1) { if ($found == 1) break; if ($p1['speed']<$time) { $p1['speed'] = $p1['speed'] * ceil ($time / $p1['speed']); } elseif ($p1['speed']==$time) { $p1turn = true; $p2turn = false; $found ++; } } foreach ($P2recruit as $p2) { if ($found == 1) break; if ($p2['speed']<$time) { $p2['speed'] = $p2['speed'] * ceil ($time / $p2['speed']); } elseif ($p2['speed']==$time) { $p1turn = false; $p2turn = true; $found ++; } } $time ++; } Then follows all the HTML to build up the page. The player who has to act gets a form with choices to do with his unit. The other player gets "Opponents turn" in that window. So in the above code you see $p1turn or $p2turn gets true or false. This is for the Jquery script at the end of all the HTML to tell wich player needs to keep polling the unit files until theres a unit for him to act. Heres the script: Code: [Select] if ($p1turn == true) { if ($battle['player2'] == $_SESSION['SESS_MEMBER_ID']) { echo " <script type='text/javascript'> function turnlistener() { $('#main').load('battlegetnextunit.php'); }; $(function() { setInterval('turnlistener()', 5000 ); }); </script> "; } } if ($p2turn == true) { if ($battle['player1'] == $_SESSION['SESS_MEMBER_ID']) { echo " <script type='text/javascript'> function turnlistener() { $('#main').load('battlegetnextunit.php'); }; $(function() { setInterval('turnlistener()', 5000 ); }); </script> "; } } Now for the first player (the one who starts the battle) he can act properly. The next player can act, but he still is longpolling the .txt files as the form resets. If he acts withing the 5 seconds (setInterval('turnlistener()', 5000 )) the other player gets his turn again but my whole computer starts strugling and i'm not able to select anything in the form. Maybe it's like the players get double longpolling the 2nd turn. But i only have the last code once and obviously only 1 of 2 can run as either $p1turn or $p2turn can be true and it can only run for one player. What could this be? Is doing it this way even possible? I'm trying to figure this out for days now, i really hope someone can help me out. Thanks! This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=320065.0 |