Search Results

Search found 55732 results on 2230 pages for 'php html'.

Page 10/2230 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • PHP include_path doesn't work

    - by 50ndr33
    I have the documents at http://www.example.com/ in /home/www/example.com/www running on Debian Squeeze. /home/www/example.com/ www/ index.php php/ include_me.php In the php.ini I've uncommented and changed to: include_path =".:/home/www/example.com" In a script index.php in www, I have require_once("/php/include_me.php"). The output I am getting from PHP is: Warning: require_once(/php/include_me.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/example.com/www/index.php on line 2 Fatal error: require_once() [function.require]: Failed opening required '/php/include_me.php' (include_path='.:/home/www/example.com') in /home/www/example.com/www/index.php on line 2 As you can see, the include-path is set correctly according to the error. But if I do require_once("../php/include_me.php");, it works. Therefore, something has to be wrong with the include-path. Does anyone know what I can do to fix it?

    Read the article

  • "Installing" GD for PHP

    - by gbuckingham89
    I'm new to server admin & Linux and have just got a VPS running CentOS 6. Apache, MySQL and PHP all came installed (along with cPanel and WHM), however I'm now also trying to install the GD library. I've run "yum install php-gd" and it installed ok. If I run it again I get "Package php-gd-5.3.2-6.el6_0.1.x86_64 already installed and latest version". However, when I do a phpinfo() or from the command line "php -m" there is no mention of GD. Is there anything else I need to do?

    Read the article

  • PHP Sessions suddenly not working

    - by styrken
    Out of no where my php sessions does not work anymore. The server have been running fine for several months. I'am running Ubuntu 11.10 (GNU/Linux 3.0.0-14-server x86_64) with nginx/1.0.11 and php 5.3.19-1~dotdeb.0 Session info copied from phpinfo() Session Support enabled Registered save handlers files user memcached Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 0 0 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies On On session.use_trans_sid 0 0 I have setup the following php script to test with: error_reporting(E_ALL); ini_set('display_errors', true); error_log($_SERVER['REMOTE_ADDR'] . ' visited test page'); if(session_start()) echo "Session started <br />"; else echo "Session failed <br />"; echo '<a href="?', time(), '">refresh</a>', "\n"; echo '<pre>'; echo 'session id: ', session_id(), "\n"; $sessionfile = ini_get('session.save_path') . '/' . 'sess_'.session_id(); echo 'session file: ', $sessionfile, ' '; if ( file_exists($sessionfile) ) { echo 'size: ', filesize($sessionfile), "\n"; echo '# ', file_get_contents($sessionfile), ' #'; } else { echo ' does not exist'; } echo PHP_EOL; $_SESSION['number'] = (int) @$_SESSION['number'] + 1; var_dump($_SESSION); echo "</pre>\n"; session_write_close(); echo 'done.'; It tells me that the session file exists, but my session id changes on each refresh.. What is going wrong? There is no output to any error logs at all.. :/ Please help!

    Read the article

  • Can the .htaccess file slow down a website to a crawl? If so, are there better ways to solve these problems with different rewrite rules and such?

    - by Parimal
    here is my htaccess file...... RewriteCond %{REQUEST_URI} ^/patients/billing/FAQ_billing\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/billing/getintouch\.html$ RewriteRule ^patients/billing/(.*)\.html$ $1.php [L,NC] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/a\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/b\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/c\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/d\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/e\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/f\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/g\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/h\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/i\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/j\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/k\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/l\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/m\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/n\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/o\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/p\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/q\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/r\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/s\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/t\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/u\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/v\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/w\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/x\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/y\.html$ [OR] RewriteCond %{REQUEST_URI} ^/patients/findadoctor/z\.html$ RewriteRule ^patients/findadoctor/(.*)\.html$ findadoctor.php?id=$1 [L,NC] like that there is lots of rules around 250 line please help me...

    Read the article

  • PHP Warning: PHP Startup: Unable to load dynamic library php_mysql.dll, Mac 10.6, Apache 2.2, php 5

    - by munchybunch
    I'm trying to use the PHP CLI, and when I enter something like php test.php in the command line it returns: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/php_mysql.dll, 9): image not found in Unknown on line 0 something test.php contains: <?php echo 'something'; ?> I checked /usr/lib/php/extensions/no-debug-non-zts-20090626/, and as expected the .dll file isn't there. I'm a complete beginner when it comes to this - what is happening, and how can I fix it? A search of my system for "php_msyql.dll" reveals nothing. Does it have to do with how I compiled it? I don't have the original version of php that came with the mac, I think - I may have reinstalled it somewhere along the way. Any help would be appreciated!

    Read the article

  • how to access mysql table from wamp database using this php code? [migrated]

    - by user3909877
    how to access tables from database by using php in wamp server.i have done the following code but its not working for some reason.is there anything to put in 'action=""'.it is not giving any error but displaying the same page.i want to display table from database on any different entry in dropdown menu and pressing search button.. <p class="h2">Quick Search</p> <div class="sb2_opts"> <p> </p> <form method="post" action="" > <p>Enter your source and destination.</p> <p> From:</p> <select name="from"> <option value="Islamabad">Islamabad</option> <option value="Lahore">Lahore</option> <option value="murree">Murree</option> <option value="Muzaffarabad">Muzaffarabad</option> </select> <p> To:</p> <select name="To"> <option value="Islamabad">Islamabad</option> <option value="Lahore">Lahore</option> <option value="murree">Murree</option> <option value="Muzaffarabad">Muzaffarabad</option> </select> <input type="submit" value="search" /> </form> </form> </table> <?php if(isset($_POST['from']) and isset($_POST['To'])) { $from = $_POST['from'] ; $to = $_POST['To'] ; $table = array($from, $to); $con=mysqli_connect("localhost"); $mydb=mysql_select_db("homedb"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } switch ($table) { case array ("Islamabad", "Lahore") : $result = mysqli_query($con,"SELECT * FROM flights"); echo "</flights>"; //table name is flights break; case array ("Islamabad", "Murree") : $result = mysqli_query($con,"SELECT * FROM `isb to murree`"); echo "</`isb to murree`>"; //table name isb to murree ; break; case array ("Islamabad", "Muzaffarabad") : $result = mysqli_query($con,"SELECT * FROM `isb to muzz`"); echo "</`isb to muzz`>"; break; //..... //...... default: echo "Your choice is nor valid !!"; } } mysqli_close($con); ?>

    Read the article

  • How do you do HTML form testing without real user input simulation ?

    - by justjoe
    this question is like this one, except it's for PHP testing via browser. It's about testing your form input. Right now, i have a form on a single page. It has 12 input boxes. Every time i test the form, i have write those 12 input boxes in my browser. i know it's not a specific coding question. This question is more about how to do direct testing on your form So, how to do recursive testing without consuming too much of your time ?

    Read the article

  • PHP - a different open_basedir per each virtual host

    - by Lopoc
    Hi I've came across on this problem, I have a sever running apache and php. We have many virtual hosts but we've noticed that a potentially malicious user could use his web space to browse other user's files(via a simple php script) and even system files, this could happens due to the php permissions. A way to avoid it is to set the open_basedir var in php.ini, yhis is very simple in a single host system, but in case of virtual hosts there would be a basebir per each host. Ho can I set dis basedir per each user/host? is there a way to let apache hereditate php privileges of the php file that has been requested E.G. /home/X_USER/index.php has as owner X_USER, when apache read the file index.php it checks its path and owner, simply I'm looking for a system set php basedir variable to that path. Thank in advance Lopoc

    Read the article

  • Recommendation for PHP-FPM pm.max_children, PHP-FPM pm.start_servers and others

    - by jaypabs
    I have the following server: Intel® Xeon® E3-1270 v2 Single Processor - Quad Core Dedicated Server CPU Speed: 4 x 3.5 Ghz w/ 8MB Smart Cache Motherboard: SuperMicro X9SCM-F Total Cores: 4 Cores + 8 Threads RAM: 32 GB DDR3 1333 ECC Hard Drive: 120GB Smart Cache: 8MB I am using ubuntu 12.04 - nginx, php, mysql with ISPConfig 3. Under ISPConfig 3 website settings: I have this default value: PHP-FPM pm.max_children = 10 PHP-FPM pm.start_servers = 2 PHP-FPM pm.min_spare_servers = 1 PHP-FPM pm.max_spare_servers = 5 PHP-FPM pm.max_requests = 0 My question is what is the recommended settings for the above variable? Because I found some using a different settings.

    Read the article

  • Install php-fpm + php-mysql + MariaDB on Centos from repos

    - by Alexander
    I try to take CentOS 6.4 x64 and install nginx w/ php-fpm on it (and that's easy part, no problem at all), then add php-mysql package and MariaDB as a mysql drop-in replacement. And here I face the hang... I've added epel, nginx and remi repos, add priority=10 line to its .repo files, and now as I install MariaDB-server the dependency also brings me MariaDB's "common" package. Then, as I try to install php-mysql, I see file /usr/share/mysql/french/errmsg.sys from install of MariaDB-server-5.5.27-1.x86_64 conflicts with file from package mysql-libs-5.5.28-1.el6.remi.x86_64 warnings. If I deinstall MariaDB server, I'm able to install mysql-libs and php-mysql, but it won't allow me to install MariaDB later. Is there any way to escape that (infinite) loop? I believe the solution is simple but still can't see it. Please help to install php-fpm + php-mysql and MariaDB as DB server!

    Read the article

  • Squid proxy not serving modified html content

    - by Matthew
    I'm trying to use squid to modify the page content of web page requests. I followed the upside-down-ternet tutorial which showed instructions for how to flip images on pages. I need to change the actual html of the page. I've been trying to do the same thing as in the tutorial, but instead of editing the image I'm trying to edit the html page. Below is a php script I'm using to try to do it. All jpg images get flipped, but the content on the page does not get edited. The edited index.html files written contain the edited content, but the pages the users receive don't contain the edited content. #!/usr/bin/php <?php $temp = array(); while ( $input = fgets(STDIN) ) { $micro_time = microtime(); // Split the output (space delimited) from squid into an array. $temp = split(' ', $input); //Flip jpg images, this works correctly if (preg_match("/.*\.jpg/i", $temp[0])) { system("/usr/bin/wget -q -O /var/www/cache/$micro_time.jpg ". $temp[0]); system("/usr/bin/mogrify -flip /var/www/cache/$micro_time.jpg"); echo "http://127.0.0.1/cache/$micro_time.jpg\n"; } //Don't edit files that are obviously not html. $temp[0] contains url of file to get elseif (preg_match("/(jpg|png|gif|css|js|\(|\))/i", $temp[0], $matches)) { echo $input; } //Otherwise, could be html (e.g. `wget http://www.google.com` downloads index.html) else{ $time = time() . microtime(); //For unique directory names $time = preg_replace("/ /", "", $time); //Simplify things by removing the spaces mkdir("/var/www/cache/". $time); //Create unique folder system("/usr/bin/wget -q --directory-prefix=\"/var/www/cache/$time/\" ". $temp[0]); $filename = system("ls /var/www/cache/$time/"); //Get filename of downloaded file //File is html, edit the content (this does not work) if(preg_match("/.*\.html/", $filename)){ //Get the html file contents $contentfh = fopen("/var/www/cache/$time/". $filename, 'r'); $content = fread($contentfh, filesize("/var/www/cache/$time/". $filename)); fclose($contentfh); //Edit the html file contents $content = preg_replace("/<\/body>/i", "<!-- content served by proxy --></body>", $content); //Write the edited file $contentfh = fopen("/var/www/cache/$time/". $filename, 'w'); fwrite($contentfh, $content); fclose($contentfh); //Return the edited page echo "http://127.0.0.1/cache/$time/$filename\n"; } //Otherwise file is not html, don't edit else{ echo $input; } } } ?>

    Read the article

  • Parse html and find data in the html

    - by Dan.StackOverflow
    Hi all. I am trying to use html5lib to parse an html page in to something I can query with xpath. html5lib has close to zero documentation and I've spent too much time trying to figure this problem out. Ultimate goal is to pull out the second row of a table: <html> <table> <tr><td>Header</td></tr> <tr><td>Want This</td></tr> </table> </html> so lets try it: >>> doc = html5lib.parse('<html><table><tr><td>Header</td></tr><tr><td>Want This</td> </tr></table></html>', treebuilder='lxml') >>> doc <lxml.etree._ElementTree object at 0x1a1c290> that looks good, lets see what else we have: >>> root = doc.getroot() >>> print(lxml.etree.tostring(root)) <html:html xmlns:html="http://www.w3.org/1999/xhtml"><html:head/><html:body><html:table><html:tbody><html:tr><html:td>Header</html:td></html:tr><html:tr><html:td>Want This</html:td></html:tr></html:tbody></html:table></html:body></html:html> LOL WUT? seriously. I was planning on using some xpath to get at the data I want, but that doesn't seem to work. So what can I do? I am willing to try different libraries and approaches.

    Read the article

  • php.ini file creation in server

    - by tibin mathew
    Hi, I am developing a php website. I cant see php.ini file in my server. my host will not provide it. So i'm now going to create a copy of that php.ini file. so i have tried system() i searched in google and i got this link. http://drupal.org/node/290592 Here they are using like this system("cp /usr/local/php5/lib/php.ini /home/YOURUSERNAME/php.ini"); in my server when i looked the phpinfo my php.ini location is /ms/svc/php5/conf/php.ini and when i looked for the current directory of my server using this $dir_path = str_replace( $_SERVER['DOCUMENT_ROOT'], "", dirname(realpath(FILE)) ) . DIRECTORY_SEPARATOR; i got my current directory as /netapp/whnas-swamp/s11/s11/01712/www.sample.com/webdocs/ so my system command will now look lke this system("/ms/svc/php5/conf/php.ini /netapp/whnas-swamp/s11/s11/01712/www.sample.com/webdocs/php.ini"); i have named this page as getthephpini.php and when i b rowse this page i got a blank page but no new php.ini file created in my server. Is any mistake in that code??? Can any one show me the correct way Please help me Thanks

    Read the article

  • embedded php in html to include header (top part of page) into the page

    - by Andy
    Hi there, I'm trying to put the top of my page (which is all html) in a seperate file so I only need to change things once like the menu bar etc. So I googled some and found a solution on this website as well, but it doesn't work and I don't know why. So I have a page like article.html and on the top I have this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <?php include("/pages/header.php"); ?> <!-- rest of the html code --> In the header.php I have the html that should be on the top of each page and it starts with: <?php /** * @author name * website header */ ?> <!-- html code --> So what's wrong with this. When I open the page article.html and right click on it to view the source, I can see the php from above calling the header.php file. Thanks!

    Read the article

  • useful customize/enhanced php functions that make thing easy and better

    - by I Like PHP
    Hello All, i like to work in php bcoz it's just amazing language. please share basic, useful, enhanced and customize function that make things better and easy in php and must be used in our all PHP project, i m sharing some of them please share your customize function that may be useful for everyone alternative/ enhanced print_r() and var_dump() function watch( $what ) { echo '<pre>'; if ( is_array( $what ) ) { print_r ( $what ); } else { var_dump ( $what ); } echo '</pre>'; } usage: 1. watch($_POST); // to see all post variable 2. watch($array); // to see any variable may b array, string or a variable enhanced mysql_escape_string() for multidimensional array to prevent sql injection function recursive_escape(&$value) { if (is_array($value)) array_map('recursive_escape', $value); else $value = mysql_escape_string($value); } usage array_map('recursive_escape', $_POST); ---------------------For encoding Get variables-------------------------------------- function nkode($k) { if ( is_array( $k ) ) return array_map("base64_encode",$k); else return base64_encode($k); } ---------------------for decoding varaibles from GET--------------------------------- function dkode($k) { if ( is_array( $k ) ) return array_map("base64_decode",$k); else return base64_decode($k); } Usage <a href="somelink.php?pid=<?php echo nkode($someid)?>"> and on next page(somelink.php) $findID=dkode($_GET[pid]); date convert to mm/dd/yyyy to yyyy-mm-dd( if we use date datatype in mysql) and also change into mm/dd/yyyy to disply on page function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($month, $day, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$month/$day/$year"; return $date; } } usage $firstDate=dateconvert($_POST['firstdate'],1); // for insertion in database $showDate=dateconvert($fetch->date_field,2) // to display on browser to clean(sql injection proof) data before doing some action with that variable function cleandata($data) { $success=0; $data=trim($data); $data=strtolower($data); $data=strip_tags($data); return $data; } usage cleandata($_POST[username]); cleandata($_GET[pid]); please share any basic function that must be used , Thanks

    Read the article

  • PHP/MySQL allowing current user to edit there account information

    - by user1837896
    i have created 2 pages update.php edit.php we start on edit.php so here is edit.php's script <?php session_start(); $id = $_SESSION["id"]; $username = $_POST["username"]; $fname = $_POST["fname"]; $password = $_POST["password"]; $email = $_POST["email"]; mysql_connect('mysql13.000webhost.com', 'a2670376_Users', 'Password') or die(mysql_error()); echo "MySQL Connection Established! <br>"; mysql_select_db("a2670376_Pass") or die(mysql_error()); echo "Database Found! <br>"; $query = "UPDATE members SET username = '$username', fname = '$fname', password = '$password' WHERE id = '$id'"; $res = mysql_query($query); if ($res) echo "<p>Record Updated<p>"; else echo "Problem updating record. MySQL Error: " . mysql_error(); ?> <form action="update.php" method="post"> <input type="hidden" name="id" value="<?=$id;?>"> ScreenName:<br> <input type='text' name='username' id='username' maxlength='25' style='width:247px' name="username" value="<?=$username;?>"/><br> FullName:<br> <input type='text' name='fname' id='fname' maxlength='20' style='width:248px' name="ud_img" value="<?=$fname;?>"/><br> Email:<br> <input type='text' name='email' id='email' maxlength='50' style='width:250px' name="ud_img" value="<?=$email;?>"/><br> Password:<br> <input type='text' name='password' id='password' maxlength='25' style='width:251px' value="<?=$password;?>"/><br> <input type="Submit"> </form> now here is the update.php page where i am having the MAJOR problem <?php session_start(); mysql_connect('mysql13.000webhost.com', 'a2670376_Users', 'Password') or die(mysql_error()); mysql_select_db("a2670376_Pass") or die(mysql_error()); $id = (int)$_SESSION["id"]; $username = mysql_real_escape_string($_POST["username"]); $fname = mysql_real_escape_string($_POST["fname"]); $email = mysql_real_escape_string($_POST["email"]); $password = mysql_real_escape_string($_POST["password"]); $query="UPDATE members SET username = '$username', fname = '$fname', email = '$email', password = '$password' WHERE id='$id'"; mysql_query($query)or die(mysql_error()); if(mysql_affected_rows()>=1){ echo "<p>($id) Record Updated<p>"; }else{ echo "<p>($id) Not Updated<p>"; } ?> now on edit.php i fill out the form to edit the account "test" while i am logged into it now once the form if filled out i click on |Submit!| button and it takes me to update.php and it returns this (0) Not Updated (0) <= id of user logged in Not Updated <= MySql Error from mysql_query($query)or die(mysql_error()); if(mysql_affected_rows()>=1){ i want it to update the user logged in and if i am not mistaken in this script it says $id = (int)$_SESSION["id"]; witch updates the user with the id of the person who is logged in but it isnt updating its saying that no tables were effected if it helps heres my MySql Database picture just click here http://i50.tinypic.com/21juqfq.png if this could possibly be any help to find the solution i have 2 more files delete.php and delete_ac.php they have can remove users from my sql database and they show the user id and it works there are no bugs in this script at all PLEASE DO NOT MAKE SUGGESTIONS FOR THE SCRIPTS BELOW delete.php first <?php $host="mysql13.000webhost.com"; // Host name $username="a2670376_Users"; // Mysql username $password="PASSWORD"; // Mysql password $db_name="a2670376_Pass"; // Database name $tbl_name="members"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // select record from mysql $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); ?> <table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="8" style="bgcolor: #FFFFFF"><strong><img src="http://i47.tinypic.com/u6ihk.png" height="30" widht="30">Delete data in mysql</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>UserName</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>FullName</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Password</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Date</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Ip</strong></td> <td align="center" bgcolor="#FFFFFF">&nbsp;</td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['username']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['fname']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['password']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['email']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['date']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['ip']; ?></td> <td bgcolor="#FFFFFF"><a href="delete_ac.php?id=<? echo $rows['id']; ?>">delete</a></td> </tr> <?php // close while loop } ?> </table> <?php // close connection; sql_close(); ?> and now delete_ac.php <table width="500" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td colspan="8" bgcolor="#FFFFFF"><strong><img src="http://t2.gstatic.com/images? q=tbn:ANd9GcS_kwpNSSt3UuBHxq5zhkJQAlPnaXyePaw07R652f4StmvIQAAf6g" height="30" widht="30">Removal Of Account</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"> <?php $host="mysql13.000webhost.com"; // Host name $username="a2670376_Users"; // Mysql username $password="javascript00"; // Mysql password $db_name="a2670376_Pass"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Delete data in mysql from row that has this id $sql="DELETE FROM $tbl_name WHERE id='$id'"; $result=mysql_query($sql); // if successfully deleted if($result){ echo "Deleted Successfully"; echo "<BR>"; echo "<a href='delete.php'>Back to main page</a>"; } else { echo "ERROR"; } ?> <?php // close connection mysql_close(); ?> </td> </tr> </table>

    Read the article

  • Linking how PHP/HTML

    - by Azzyh
    Hello. Alright so im done doing pages with frames, and know i splitted up my design to top.php and bottom.php. In top.php it's linking to style.css and ajax_framework.js and such.. Now this works great until i tried to include top.php & bottom.php in videos/index.php (another dirr), i did like this: include "../top.php"; <-- and the originally index.php --> include "../bottom.php"; Now when i enter the site, it wont load style.css, probably because it thinks that style.css needs to be in videos/ directory, same goes with ajax_framework.js that are both files are on the parent ../ directory. Now what do i do? Some method or technique to solve this in a good way? So i dont have to copy style.css and ajax_framework.js into every directory i have, because then later if i want to change something i would need to change in all directories, which would be my last thing i want to do.. hope you got some nice techniques thank you

    Read the article

  • PHP Browser Game Question - Pretty General Language Suitability and Approach Question

    - by JimBadger
    I'm developing a browser game, using PHP, but I'm unsure if the way I'm going about doing it is to be encouraged anymore. It's basically one of those MMOs where you level up various buildings and what have you, but, you then commit some abstract fighting entity that the game gives you, to an automated battle with another player (producing a textual, but hopefully amusing and varied combat report). Basically, as soon as two players agree to fight, PHP functions on the "fight.php" page run queries against a huge MySQL database, looking up all sorts of complicated fight moves and outcomes. There are about three hundred thousand combinations of combat stance, attack, move and defensive stances, so obviously this is quite a resource hungry process, and, on the super cheapo hosted server I'm using for development, it rapidly runs out of memory. The PHP script for the fight logic currently has about a thousand lines of code in it, and I'd say it's about half-finished as I try to add a bit of AI into the fight script. Is there a better way to do something this massive than simply having some functions in a PHP file calling the MySQL Database? I taught myself a modicum of PHP a while ago, and most of the stuff I read online (ages ago) about similar games was all PHP-based. but a) am I right to be using PHP at all, and b) am I missing some clever way of doing things that will somehow reduce server resource requirements? I'd consider non PHP alternatives but, if PHP is suitable, I'd rather stick to that, so there's no overhead of learning something new. I think I'd bite that bullet if it's the best option for a better game, though.

    Read the article

  • Managing JS and CSS for a static HTML web application

    - by Josh Kelley
    I'm working on a smallish web application that uses a little bit of static HTML and relies on JavaScript to load the application data as JSON and dynamically create the web page elements from that. First question: Is this a fundamentally bad idea? I'm unclear on how many web sites and web applications completely dispense with server-side generation of HTML. (There are obvious disadvantages of JS-only web apps in the areas of graceful degradation / progressive enhancement and being search engine friendly, but I don't believe that these are an issue for this particular app.) Second question: What's the best way to manage the static HTML, JS, and CSS? For my "development build," I'd like non-minified third-party code, multiple JS and CSS files for easier organization, etc. For the "release build," everything should be minified, concatenated together, etc. If I was doing server-side generation of HTML, it'd be easy to have my web framework generate different development versus release HTML that includes multiple verbose versus concatenated minified code. But given that I'm only doing any static HTML, what's the best way to manage this? (I realize I could hack something together with ERB or Perl, but I'm wondering if there are any standard solutions.) In particular, since I'm not doing any server-side HTML generation, is there an easy, semi-standard way of setting up my static HTML so that it contains code like <script src="js/vendors/jquery.js"></script> <script src="js/class_a.js"></script> <script src="js/class_b.js"></script> <script src="js/main.js"></script> at development time and <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="js/entire_app.min.js"></script> for release?

    Read the article

  • PHP-FPM stops responding and dies [migrated]

    - by user12361
    I'm running Drupal 6 with Nginx 1.5.1 and PHP-FPM (PHP 5.3.26) on a 1GB single core VPS with 3GB of swap space on SSD storage. I just switched from shared hosting to this unmanaged VPS because my site was getting too heavy, so I'm still learning the ropes. I have moderately high traffic, I don't really monitor it closely but Google Adsense usually record close to 30K page views/day. I usually have 50 to 80 authenticated users logged in and a few hundred more anonymous users hitting the Boost static HTML cache at any given moment. The problem I'm having is that PHP-FPM frequently stops responding, resulting in Nginx 502 or 504 errors. I swear I have read every page on the internet about this issue, which seems fairly common, and I've tried endless combinations of configurations, and I can't find a good solution. After restarting Nginx and PHP-FPM, the site runs really fast for a while, and then without warning it simply stops responding. I get a white screen while the browser waits on the server, and after about 30 seconds to a minute it throws an Nginx 502 or 504 error. Sometimes it runs well for 2 minutes, sometimes 5 minutes, sometimes 5 hours, but it always ends up hanging. When I find the server in this state, there is still plenty of free memory (500MB or more) and no major CPU usage, the control and worker PHP-FPM processes are still present, and the server is still pingable and usable via SSH. A reload of PHP-FPM via the init script revives it again. The hangups don't seem to correspond to the amount of traffic, because I observed this behavior consistently when I was testing this configuration on a development VPS with no traffic at all. I've been constantly tweaking the settings, but I can't definitively eliminate the problem. I set Nginx workers to just 1. In the PHP-FPM config I have tried all three of the process managers. "Dynamic" is definitely the least reliable, consistently hanging up after only a few minutes. "Static" also has been unreliable and unpredictable. The least buggy has been "ondemand", but even that is failing me, sometimes after as much as 12 to 24 hours. But I can't leave the server unattended because PHP-FPM dies and never comes back on its own. I tried adjusting the pm.max_children value from as low as 3 to as high as 50, doesn't make a lot of difference, but I currently have it at 10. Same thing for the spare servers values. I also have set pm.max_requests anywhere from 30 to unlimited, and it doesn't seem to make a difference. According to the logs, the PHP-FPM processes are not exiting with SIGSEGV or SIGBUS, but rather with SIGTERM. I get a lot of lines like: WARNING: [pool www] child 3739, script '/var/www/drupal6/index.php' (request: "GET /index.php") execution timed out (38.739494 sec), terminating and: WARNING: [pool www] child 3738 exited on signal 15 (SIGTERM) after 50.004380 seconds from start I actually found several articles that recommend doing a graceful reload of PHP-FPM via cron every few minutes or hours to circumvent this issue. So that's what I did, "/etc/init.d/php-fpm reload" every 5 minutes. So far, it's keeping the lights on. But it feels like a dreadful hack. Is PHP-FPM really that unreliable? Is there anything else I can do? Thanks a lot!

    Read the article

  • PHP Drupal alternatives

    - by Quinma
    Based off answers to this question: Will I pick bad coding habits from PHP books? and many others it is a general consensus that PHP is not the most well suited language for web development anymore (if you are not completely knowledgeable about the language). I use Drupal and write custom modules in PHP, does this viewpoint of PHP being an ill fitted web coding language also apply to Drupal based PHP sites? I generally build community sites and intra-company sites, are there better means of building these than with PHP and drupal frameworks?

    Read the article

  • zend tool is not working

    - by user362155
    Hi, I've installed ZendStudio 7.2 it creates project normally with no error but when i try to add action(s) in it, it says project profile does not exist. and the error log is as follow: executing zf create action showLatest index-action-included An Error Has Occurred A project profile was not found. Zend Framework Command Line Console Tool v1.10.2 Details for action "Create" and provider "Action" Action zf create action name controller-name[=Index] view-included[=1] module Failed loading ./ZendDebugger.so: (null) PHP Warning: PHP Startup: Unable to load dynamic library './ext/bcmath.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/bz2.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/calendar.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ctype.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/curl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/exif.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/fileinfo.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ftp.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/gd.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/imagick.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/json.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/ldap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mbstring.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mcrypt.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/memcache.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mhash.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mime_magic.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mssql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/mysqli.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pcntl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/pgsql.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/posix.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/shmop.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/soap.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sockets.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sqlite.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvmsg.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvsem.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/sysvshm.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tidy.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/tokenizer.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/wddx.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlreader.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xmlrpc.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/xsl.so' - (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './ext/zip.so' - (null) in Unknown on line 0 please help me to configure latest ZendTool with ZendStudio 7.2 or how can i get rid of this. i am runin ZS 7.2 on my mac os x 10.5.8 thanks.

    Read the article

  • php download file slows

    - by hobbywebsite
    OK first off thanks for your time I wish I could give more than one point for this question. Problem: I have some music files on my site (.mp3) and I am using a php file to increment a database to count the number of downloads and to point to the file to download. For some reason this method starts at 350kb/s then slowly drops to 5kb/s which then the file says it will take 11hrs to complete. BUT if I go directly to the .mp3 file my browser brings up a player and then I can right click and "save as" which works fine complete download in 3mins. (Yes both during the same time for those that are thinking it's my connection or ISP and its not my server either.) So the only thing that I've been playing around with recently is the php.ini and the .htcaccess files. So without further ado, the php file, php.ini, and the .htcaccess: download.php <?php include("config.php"); include("opendb.php"); $filename = 'song_name'; $filedl = $filename . '.mp3'; $query = "UPDATE songs SET song_download=song_download+1 WHER song_linkname='$filename'"; mysql_query($query); header('Content-Disposition: attachment; filename='.basename($filedl)); header('Content-type: audio/mp3'); header('Content-Length: ' . filesize($filedl)); readfile('/music/' . $filename . '/' . $filedl); include("closedb.php"); ?> php.ini register_globals = off allow_url_fopen = off expose_php = Off max_input_time = 60 variables_order = "EGPCS" extension_dir = ./ upload_tmp_dir = /tmp precision = 12 SMTP = relay-hosting.secureserver.net url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset=" ; Defines the default timezone used by the date functions date.timezone = "America/Los_Angeles" .htaccess Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} !^(www.MindCollar.com)?$ [NC] RewriteRule (.*) http://www.MindCollar.com/$1 [R=301,L] <IfModule mod_rewrite.c> RewriteEngine On ErrorDocument 404 /errors/404.php ErrorDocument 403 /errors/403.php ErrorDocument 500 /errors/500.php </IfModule> Options -Indexes Options +FollowSymlinks <Files .htaccess> deny from all </Files> thanks for you time

    Read the article

  • parsing simple html for iphone

    - by sitara
    I have a very simple html page to parse. The html page will remain simple always. as simple as this <html> <head><title>title</title></head> <body>some data here</body> </html> I have fetched the html content of such an html page and have it in an NSString. I want to get what ever data is there in the body of the html page. Please tell me how can this be done and let me know if there are more than one possible ways. I would prefer doing it using basic obj-c if it is possible. Thanks

    Read the article

  • PHP: gethostbyname() suddenly no longer resolves names to IPs when run in Apache

    - by hurikhan77
    One of our older legacy servers which gets no further updates or reconfigurations suddenly stopped resolving hostnames to IPs when PHP is executed within Apache. However, it still works fine when executed from the CLI. From the RSS caches last modification time, I deduce that it stopped working on around Mar, 28th. To reproduce the problem, I created a script using fsockopen() and it said "connection failed (errno 2)". I further reduced the problem to being related with a failed name resolution: <?php $addr = gethostbyname("twitter.com"); echo "ADDR($addr)"; ?> When I run this through Apache, the output is ADDR(twitter.com), which is wrong. When I run this from the CLI, the output is ADDR(aaa.bbb.ccc.ddd) with varying IP addresses, as expected. Nothing on the server setup has changed. CLI and Apache module share the same php.ini. PHP is version v4.4.9 with Zend Optimizer v2.5.10. Apache is v1.3.31. I know the versions are old. But since nothing has been changed, a solution like "try to upgrade versions first" is no solution as the server's feature set/versioning is frozen and will be replaced soon. Still we need a solution. If I run dig through the script, it works in both environments (mod_php and CLI) but this is more than an ugly hack as it would involve many edits and testing throughout the whole script base which is also undesired as the PHP application on the server is frozen, too, and only receives security updates. It will be replaced by a complete rewrite (on the new server). But as the rewrite will take some time and successive replace parts of the legacy application, we need a fix for the resolver problem. I already googled a bit and while the problem is known, many did not find a fix. The fix to raise memory limits did not work. Restarts did not work. The resolver in mod_php just did stop working for no apparent reason. :-(

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >