PHP - Site Permanently Loading
Hi, not sure if this is the correct forum, so apologies, i assumed it was a php problem.
Anyway, all of the pages on my site are permanently loading. http://dev.subverb.net contains a few external scripts from twitter and facebook, so I assumed it could be that, but even ones like http://dev.subverb.net/mix.php always are loading. I can't figure out on firebug how to find what is loading, because it doesnt seem to tell me in the net profile, just what has already been loaded. Any help? Similar Tutorialshi, when I made my website I thought it would be a good idea to put the information I'm outputting in a function so I could just call that function on a single template page. However, everytime I load a page on the server it loads all the static content first (ie, sidebar, logo, ect.) Then it loads the dynamic content. I'm okay with this, but it also doesn't add in the background until after it loads the dynamic content (which bothers me). Can I re-arrange my site's coding to prevent this? Thanks - charlie PS: my site is www.rushhunt.com try to install orm peewee on opensuse 13. 1 but unfortunatly it failed martin@linux-70ce:~> martin@linux-70ce:~> git clone https://github.com/coleifer/peewee.git Klone nach 'peewee'... remote: Reusing existing pack: 5673, done. remote: Counting objects: 13, done. remote: Compressing objects: 100% (13/13), done. remote: Total 5686 (delta 2), reused 0 (delta 0) Empfange Objekte: 100% (5686/5686), 3.54 MiB | 102.00 KiB/s, done. Löse Unterschiede auf: 100% (3468/3468), done. Prüfe Konnektivität... Fertig martin@linux-70ce:~> cd peewee martin@linux-70ce:~/peewee> python setup.py install running install error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/test-easy-install-5717.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/lib/python2.7/site-packages/ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://pythonhosted.org/setuptools/easy_install.html Please make the appropriate changes for your system and try again. martin@linux-70ce:~/peewee> what can i do now I'm showcasing user avatars and nicknames on the page, the mistake I did was I used session variables for that which are being set after login, now obviously those will be deleted as soon as the session is over. So I thought of inserting the values into scalar variables instead of session variables. The problem I'm encountering is, how to make those variables available at the necessary spots on other pages? Let's say I fetch data off the database after login inside login.php and I put the data into scalar variables, what would be common practice to make those scalar variables accessible in index.php? Is this solution a good solution at all to make the avatar and nickname of the user permanent visible? What would be common practice? I'm attempting to set up a script that will choose a "random" image from a directory and then place it in an article when it's posted. I currently have a php file that randomly assigns a picture on each refresh, however my employer wants the image to be static after posting. So I guess the short of my question is, what would be the best way to go about something like that or is it even doable with PhP. I have several "sites" located in my html directory, and each has a "general" access point and an "administrator" access point:
/var/www/html/site1/index.php /var/www/html/site1/administrator/index.php /var/www/html/site2/index.php /var/www/html/site2/administrator/index.php /var/www/html/site3/index.php /var/www/html/site3/administrator/index.phpAll sites are similar except that data will be specific to site1, site2, or site3, etc. Users who log onto /var/www/html/siteX/index.php are totally unrelated to those who logon to /var/www/html/siteX/administrator/index.php, will have different logon credentials, are stored in different DB tables, and each should have their own session. If a user logs off of either the general or administrator site, it should not effect the other site even if they were previously logged on to both on the same PC (and of course not effect other sites). When a user logs off, I would like to destroy their previous cookie and associated session. Users for either will only use https. I am using Apache to rewrite https://www.mysite.com/ to https://mysite.com/. While I named the administrator site "administrator" above, the administrator user has the ability to change the directory name. I am thinking I need to use session_set_cookie_params to specify where I wish the session cookie to be stored since /var/www/html/siteX/administrator/index.php is a sub-directory to /var/www/html/siteX/index.php, but am not really sure. Sorry for the cryptic post, but I am not very well versed in this subject. How would you recommend setting up cookies/sessions for this scenario? Thank you Hi, My first post here is a cry for help I have a Windows 2003 server running IIS6/PHP5, the server hosts multiple web sites. The problem is include files that are for site A are showing on site B (each site having its own includes as part of the site files in its own site folder), though not every time, its very random, sometimes the correct includes show, sometimes ones from another site on the same server. This only occurs where the include files for both sites have the same name, such as 'inc-header.php' for example. I can only assume PHP is caching includes and because they have the same name is showing the wrong one on other sites sometimes, if I rename them to something unique then the problem goes away, but its not a practical solution to rename all include files to unique names so I find myself looking for a 'real' fix. I have a feeling its to do with the include_path in the php.ini, but right now its disabled with a semi-colon, and I don't want to set one as I have no global includes, all includes are site specific. Any help would be very much appreciated! Phil now i use this code to show where the visitors came from to my site. <?php $referer=$_SERVER['HTTP_REFERER']; echo $referer; ?> now, i want to show the 5 latest vistors referer's site url on my site ? Not sure if I'm trying to achieve something totally crazy here, or if this is something pretty standard. Didn't have much luck with searching as I'm not fully down with all the terms. (A) I have one site providing an RSS feed. (B) I have one site I want to search, once for each of the items in the feed A. (C) I want the results of the search in (B) to be displayed on page (C). So for example, the feed on (A) says; apples bananas oranges cheese I want site (B) to search for each of those terms (by passing the item in the feed (A) to the ?search= part of the URL of that page) and then show the results from THAT search on page C. Bit of a complex one, let me know if you need me to clarify. Thanks for any help! Transferring data from sub-domain.site.com Reading sub-domain.site.com What is this all about? I'm going to put all .. images into a separate sub-domain eg: images.site.com. This would create a folder inside my public_HTML called "images" Now when sites have that Transferring data, and Reading... is this .. something relating to what I want. Facebook also does it, and they get their images for the site from a sub domain, how is it all done? I'm not sure if its entirely PHP, but I hope someone can help. Thanks I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php),
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<div class="media margin-none"> <a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a> <div class="media-body innerAll"> <h4 class="media-heading innerT"> <a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4> <p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>'; echo '</div> </div> <div class="col-separator-h"></div>'; } echo pagination($statement,$per_page,$page, $url_filtros, $filtros); ?>it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss? Thanks Hi I made a new design for my website and I made some changes. I want to use layout for my second site.
I'll like to know if my site is easier to browse through now and if you like the design better?. I test my site on internet explorer, chrome, and firefox. It is best to use site on better browsers like firefox and chrome to get a better experience of site. Thanks.
http://adjade.com
This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=318858.0 (I looked at the appropriate forums to put this in, but it seems I couldn't find a forum section specifically for this problem) Yesterday PHP on WAMP was working perfectly. So I shutdown the computer, go to sleep, and wake up and turn WAMP on. But for some odd reason, when none of my PHP files are loading properly. It just shows all the code as if it were a .txt file. Any reasons for this? Hello everyone, I have a PHP shopping cart I am working on. I have all my pictures stored in a folder url directory of my project. In my SQL database I have an image table that holds all of the image names. When I load the picture names with my php It somehow adds some extra random characters to the directory path: /img/%7B$row_product_image[name]%7D 404 (Not Found) If I hardcode the image directory img/picturename.jpg It works. Here is what I have. <?php include_once "objects/database.php"; include_once "objects/product.php"; include_once "objects/product_images.php"; // object instances $database = new Database(); $db = $database->getConnection(); $product = new Product($db); $product_image = new ProductImage($db); $recordsPerPage = 1; while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { extract($row); echo '<div class="col-md-4 mb-2">'; echo '<div class="product-id d-none">{$id}</div>'; echo '<a href="product.php?id={$id}" class="product-link">'; $product_image->product_id = $pid; $stmt_product_image = $product_image->readFirst(); while($row_product_image = $stmt_product_image->fetch(PDO::FETCH_ASSOC)) { echo '<div class="mb-1">'; echo '<img src="img/{$row_product_image[name]}" class="w-100" />'; echo '</div>'; } echo '<div class="product-name mb-1">{$name}</div>'; echo '</a>'; echo '</div>'; } class ProductImage { private $pdoConn; private $table_name = "product_images"; public $id; public $product_id; public $name; public $timestamp; public function __construct($dbconn) { $this->pdoConn = $dbconn; } function readFirst() { // SELECT query $query = "SELECT id, pid, name " . "FROM " . $this->table_name . " " . "WHERE pid = ? " . "ORDER BY name DESC " . "LIMIT 0, 1"; // prepare query statement $stmt = $this->pdoConn->prepare($query); // sanitize $this->product_id=htmlspecialchars(strip_tags($this->product_id)); // bind variable as parameter $stmt->bindParam(1, $this->product_id); // execute query $stmt->execute(); // return values return $stmt; } } ?>
I got problem with one of my php page. Mozilla browser keeps on loading although it shows the page, i am not really sure which part is wrong. But i don't find any problem with other browsers lol. Can anyone help me please thanks in advance I seem to have a problem with a PHP page I made. When executed on the server, it loads with a filesize 0 and for some browsers, says it does not exist. I believe that the cause is because it is not parsing due to a syntax error. I've busted my @$$ over this code, trying to find the issue, but cannot find it. Here is the whole page's code on pastie: http://pastie.org/1064160 Hi! This code, which is basically HTML and Javascript, echoed in PHP (as you can see in the attached image), has functioned well for a long time. It still does, if put in a page by itself. The problem now is when it is integrated in other PHP scripts. It does not work this way on either the live server or on WAMP anymore. This script is normally setup to be execute about half way through the complete script of the page and has functioned well, showing approx. the top half of the page, as well as a loading gif. When the PHP workload is complete, the loading gif is removed and the rest of the page is displayed. Now with the later versions of PHP, all I see is a blank page until all the script is executed, which can take about 15 seconds or more. PHP does not release the information to Apache, or if it does, Apache does not do anything with it. I have tried different approaches, using ob_flush() and so on, but it just will not function. I would like to know if someone else has had this issue, or knows about it and if there is any current solution. I have not managed to find any working solution that will work with PHP 7.4 and in the future, on the net. I know one cannot predict all the changes that will occur with PHP in the future, but I would like the solution to function for at least 3-5 future versions. I am now going to try something completely different outside the box and create a start page instead. If it does work, it will just be a temporary solution though. Thanks for any assistance beforehand. Mac Edited October 24, 2020 by MacDknife spelling error Hi I have website where users can upload pictures on server. Sometimes it take 4-5 seconds until the upload it's finish. What can I do that when I click on upload button an icon appear in middle of the screen and disappear then the pictures was finish uploading. Thanks Hey guys, Problem: php script keeps loading and i dont know why. What I've done so far is commenting out line-by-line so I found out that the problem is somewhere he Code: [Select] <div id="wrapper"> <div id="inner"> <div id="top"> <?php require 'basic/logo.php';?> <?php require 'basic/header.php';?> </div> its not working - keeps loading. Commenting out the 'required' stuff it works... error_reporting(E_ALL); is on... what the hell is the problem?! the files are there in /basic. Just dont know any further! Lets say that I have an array that I want to convert to a value object My value object class is as follows: /* file UserVO.php*/ class UserVO { public $id; public $email; public function __construct($data) { $this->id = (int)$data['id']; $this->email = $data['email']; } } And I create my array of value objects as follows: /* file UserService.php*/ $array = array( array(...), array(...)); $count = count($array); for ($i = 0; $i < $count; $i++) { $result[] = new UserVO($array[$i]); } return $result; OK, so this all works fine. However, I'd like to specificy the VO that is to be created dynamically, so that I can have a single dynamic function to create my VO's. Something like: $ret = create_vo($array, 'UserVO'); function create_vo($data, $vo) { $count = count($data); for ($i = 0; $i < $count; $i++) { $result[] = new $vo($array[$i]); //this obviously wont work...Class name must be a valid object or a string } return $result; } I realise that I could do this with a switch statement (iterating through all my VO's)...but there is no doubt a much much more elegant solution. It would also be supercool if I could lazy load the VO's as needed, instead of having multiple 'includes' Any help much appreciated. |