Search the Community
Showing results for tags 'php'.
-
Bootstrap 3.2.2 - Darkly Theme from http://bootswatch.com/darkly/ Seems to work fine on the site but not when used in my files. Here's my code, pretty much similar to the template code provided in the navigation bar but removed the brand and moved the dropdown to the left. <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- <a class="navbar-brand" href="#">Brand</a> --> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Brands <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li class="divider"></li> <li><a href="#">Separated link</a></li> <li class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Sign up</a></li> <li><a href="#">Log-In</a></li> </ul> </div> </div></nav> Other info if this matters: <head> <link href="css/bootstrap.css" rel="stylesheet" /> <script src="js/bootstrap.js"> </script></head> Tried including <link href="css/bootstrap-theme.css" rel="stylesheet" />, it's not helping either nor the inclusion of the bootstrap.js, has anyone encountered this? How did you get it to work?
-
Hi, My web server recently got hacked by someone uploading a .php file which gave them control to the web server. From the CMS I did not allow anyone to upload any files other than .jpg .png (image files). I did some googling around and I found that you can tamper with the upload so you can upload an allowed file e.g. .jpg and then tamper with it before it actually it uploaded to .php. This way the web server thinks you have uploaded a .jpg file but in fact it was a .php if you know what I mean. Is there a way to completely stop all .php files to the website? I guess I can add a .htaccess file that days if file matches to ".php" then do not allow But is there any other way of stopping this, at FTP level or server level? Any information will be greatly appreciated. I am using CentOS 6.5. Thanks
-
Hello I'm planning to design a website and I saw other designers use either a plain text file or sql db to store data. Now I'm wondering if it is possible to save the data as lua/python/perl/etc. scripts? And is this a safe way to store data or not? I had a bad experience with SQL db where for some reason the db was corrupted when my PC turned off suddenly and I lost all the data. I'm speculating that maybe plain text files or what I'm asking here is a much more stable way of storing data.
-
After installing LAMP via tasksel, I'm able to access the "It works" test page at http://localhost/ however after creating phptest.php in var/www, I get a 404 when trying to access http://localhost/phptest.php. Any help would be appreciated. My www directory: bartosik@bartosik-ThinkPad-X131e:/$ cd var/www bartosik@bartosik-ThinkPad-X131e:/var/www$ ls -l total 12 drwxr-xr-x 2 root root 4096 Dec 13 20:34 html -rw-r--r-- 1 root root 22 Dec 13 20:45 phptest.php -rw-r--r-- 1 root root 22 Dec 13 20:36 phptest.php~ bartosik@bartosik-ThinkPad-X131e:/var/www$ The contents of phptest.php: <?php phpinfo(); ?>
-
Hello, i hope you all are doing well, I'm developing wordpress plugin that will allow people to create google hangouts group and that group will display on a website, whenever someone wenst to my website he will see all google hangouts groups and how much people are in those groups talking ( i know max is 10 ). He will be able to create his own group and if he will do that his group also will display in website OR he will be able to join existing groups and talk with people. My questions: 1. How can i use google hangouts API in php/javascripts ( more examples better ) 2. How can i get people that are in hangouts group and display with php/javascript in my website their photos if they does not have photos it will show default picture that i will select with code. 3. How can i display groups on website with php/javascript whenever group is created by user? More examples more better for these questions, main problem that i dont know how to insert and use tgoogle hangouts api and i find difficult to regonize if documentation that i'm reading is for website or for mobile app for example: https://developers.google.com/+/hangouts/api/gapi.hangout here i found class Participant( which how i understand allows to get people information from the hangout group and display it somewhere, but the problem is i dont understand wether this is for website or for something else, if i would know answers or see examples to my questions it would be much easier to develop what im trying to do, because i was searching for hours really did and didn't find anything understandable and i'm not noob on php just i find this especially hard. Kind Regards, Evelina
- 3 replies
-
- google-plus
- php
-
(and 4 more)
Tagged with:
-
the code below prints the following pic to the screen but it prints it 4 times have looked for a cause no luck please help <?php$handle = fopen("vote.txt", "r");if ($handle) {print('<table style="width:75%" border="1">'); while (($line = fgets($handle)) !== false) {# print_r($array);$array=explode(",",$line); foreach ($array as $n) {print('<tr>' . "\n");print('<td>' . $array[0] . '</td>' . "\n");print('<td>' . $array[1] . $array[2] . '</td>' . "\n");print('<td>' . $array[3] . '</td>' . "\n");print('</tr>');$count++;if($array[3]='Grover'){$a++;}else if($array[3]='Grover'){$a++;}else if($array[3]='Grover'){$a++;}else if($array[3]='Grover'){$a++;}else{print ("Your doing it wrong");}} }if($count>=$a){print("<br><h1> Grover </h1>"); }else{print ("FAIL");} } else { print("soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>soiled it <br>");} fclose($handle);?> this is the .csv file it is reading 232323, Night, Rider, Grover123456, fred, long, Grover
-
Hi everyone, I'm just wondering if there is a way to choose where to save a file in a web application. I know it is very unsecure, and I also know that the browser is the one who chooses where to save a file when downloading. But I am not making a consumer/public website, I'm currently making a private system so I need a way on how to force a web application to show the "Save as" dialog and enable the user to choose where they want to save the file. Thank you all in advance....
- 3 replies
-
- php
- programming
-
(and 5 more)
Tagged with:
-
Hello everybody, I wanted a little help choosing a good computer for graphic designing in Photoshop, animating in Flash, programming in PHP and other web languages, and Java and Android games. I want to spend the less I can and have good performance. How much RAM will I be needing? Good CPU that can handle many programs open? SSD or HDD? Do I need a good graphics card? Linux Or Windows? Thank you! Anything helps
-
I'm working on a project that involves fetching some data from another server (which is beyond my control). This data happens to be broken into several (hundreds) of fairly small XML files. Now, this server (or the connected to it) is fairly slow, it takes a few seconds to grab each file. Consequently, if I linearly fetch all of these XML files, the PHP script takes minutes to execute. Now, I have minimal experience with threading, but what I do know is that you shouldn't create a plethora of threads. For example, after compiling php with thread support, I tried to humor myself by creating one thread per file to download. Low and behold my script executed in seconds, with accurate results. Unfortunately this is plays havoc with the thread management and all that, and after executing a few times the pc just dies, which is a behavior I wasn't expecting. Does anyone know the best solution to this type of problem? Am I close, or am I approaching it in completely the wrong way. (If possible I'd rather avoid using PHP threads, because I don't like using my self-compiled apache/php. I much prefer the debian bundled versions)
-
Hi, I am developing a website for my dad's welding and fabrication business and I am looking for tips on usability, while also maintaining good looks. I apologise in advance for the slow load time, this site is on a dev server in my office, and, being in Australia, the internet is really slow (approx. 400Kbps) upload. The link to the site is below. http://fish.cairnspc.com/psw_dev/ Thanks
-
Hello I began learning how to make a website a while ago. I completed codeacademy.com all the way through python about 2 months ago (including html, css, jquery, and javascript). However, when I look back on these lessons, I remember very little. I also found that codeacademy and other tutorials seemed incomplete and only went over the basics. So, I would like something, preferably a book, that can teach me how to make a complete website. I would like the book to include html5, css, php, and jquery. I would like it to start off at the basics, but still be able to teach me more advanced features of web development. Thanks for the help
-
Greetings viewers! So over the past 6 months, I've been playing with PHP (mostly procrastinating and filling the gaps between classes) and I feel fairly comfortable with it. Except that I use it largely functionally and not as an object-oriented language. Although I have a fair understanding of why you'd be inclined to create PHP classes (personally, I'd use them for storing a load of static variables and methods) I'm not really sure under what circumstances I'd create objects. More background: In Java or C++, you have a standalone application or process that runs for perhaps weeks at a time and the data (objects) are persistent between sessions (maybe closing the session doesn't even terminate the process). PHP on the other hand, feels like a new process per page load and the data stored in the objects doesn't seem as persistent. Additionally, PHP is weird in that you have to reload the page to make changes (I'm ignoring AJAX temporarily). That said, something like a chess program makes little sense in PHP as opposed to JavaScript. I'm certain I'm being intensely ignorant of some crucial part of PHP in this post but any insight is appreciated. The internet wasn't very helpful in this regard. Thanks for looking!
-
I have a page "quick.php" This page should check if a cookie is stored by my login script. Withouth the php code, both the form and button work perfectly fine, when i check if the cookie is set, and use an else statement, the page refuses to load. The background and title of the page also won't load. <html> <head> <title> <?php include 'config.php'; echo $title; ?> | Login </title> <!-- Latest compiled and minified CSS --><link rel='stylesheet' href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css'><!-- Optional theme --><link rel='stylesheet' href='//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css'><!-- Latest compiled and minified JavaScript --><script src='//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js'></script> <link href='//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet'> <link href='css/global.css' rel='stylesheet'> </head> <body> <div id='fullscreen_bg' class='fullscreen_bg'/><div class='container'><?phpif (isset($_COOKIE['login'])){ echo" <a href='logout.php' class='btn btn-lg btn-primary btn-block'> Sign Out </a> "}else{ echo " <form class='form-signin' name='login' method='post' action='login.php'> <h1 class='form-signin-heading text-muted'>Sign In</h1> <input type='password' name='password' class='form-control' placeholder='Password' required='' autofocus=''> <button class='btn btn-lg btn-primary btn-block' type='submit'> Sign In </button> </form> "}?></div> </body></html> Thanks for the help!
-
Hello LinusTechTips community! I am in need of some help and maybe some resources for a Live chat system I plan on developing for my panel. The chat would need the following: Auto refreshing Fast Non-Resource intensive It would only have to between 3 people the Myself(just to observe), the Employee & the Client Functions Main Chat page w/ 5 second refreshing Send Button Any thing else that might be needed I already have the login & registar system in place. Thanks for any help you may able to provide! EDIT: We use Unique ID's for each project 1 Chat per project All logged. P.S. Im not the greastest at PHP.
- 9 replies
-
- php
- web development
-
(and 6 more)
Tagged with:
-
I'd like to make a website so I can do pre-managed actions "on-the-go" Is it safe for me to make my own webpage (hosted) where I declare a PHP variable, and ask for an input. Than when the input equals the PHP variable, let me see the page. Since I only need 1 account, i don't think it is necessary to make a whole login page with an MySQL DB. Is this safe and is this a good way to solve my "problem" ? Thanks in advance.
-
I have been thinking about making a tutorial for beginners for some time but never had the time. Now that I have some free time, I decided to begin now. I am hoping to start two series. The first series is a beginners/intermediates tutorial while the second series is a user’s choice tutorial where users PM me a topic title they want me to create a tutorial for and after a vote I will create a tutorial showing how to code the choice with the most vote. The topic titles can be in the form “how to make a calculator in VB”, “how to make a Point of Sale website” or something along those lines. I will also be answering any question that any users might have in text or video form depending on the question that the users ask. I hope you will give me feedback by replying. The feedbacks can be about improvement that can be made to my idea and/or any other feedback you might have. NOTE: This is just a thread to see what the user feedback is. Do not send me a topic title for the second series before I update this thread or create a new one. Edit: Updated poll to include more options.
- 11 replies
-
- programming
- desktop applications
-
(and 5 more)
Tagged with:
-
In short, I want this: [0] => Array ( [TPartsLoadingAndUnloadingMain] => Array ( [parts_loading_and_unloading_id] => 80660 [loading_and_unloading_day] => 2004-05-07 00:00:00 ) [MCustomer] => Array ( [customer_name] => 株式会社コベコン.エアーテクノ ) [MMachine] => Array ( [initial] => ) ) [1] => Array ( [TPartsLoadingAndUnloadingMain] => Array ( [parts_loading_and_unloading_id] => 80661 [loading_and_unloading_day] => 2004-05-07 00:00:00 ) [MCustomer] => Array ( [customer_name] => 株式会社コベコン.エアーテクノ ) [MMachine] => Array ( [initial] => BC- ) ) To be like this: [0] => Array ( [parts_loading_and_unloading_id] => 80660 [loading_and_unloading_day] => 2004-05-07 00:00:00 [customer_name] => 株式会社コベコン.エアーテクノ [initial] => ) [1] => Array ( [parts_loading_and_unloading_id] => 80661 [loading_and_unloading_day] => 2004-05-07 00:00:00) [customer_name] => 株式会社コベコン.エアーテクノ [initial] => BC- ) Can anyone help help me?
-
YouTube api help (php unless you convince me otherwise)
colonel_mortis posted a topic in Programming
I am trying to make a better youtube subscription box (after Linus complained about it on the WAN show ) that will get all of the subscriptions a user has, find out the videos their subscriptions have loaded and then display the most recent ones in a page. I have identified the page from which you can find the subscriptions to be http://gdata.youtube.com/feeds/api/users/default/subscriptions?v=2 but when I try to load it, either through the google api demo (by manually editing the url), directly (by adding in my auth key as a parameter), or through my web app (having, as far as I know, authenticated with OAuth), it stays loading for ages before returning a 401 unauthorized message in the json that's returned -
A Small Introduction to mincss Note: I'm a not experienced with Python. I have some general knowledge about it and some scripting experience with other languages as well as some programming knowledge in C/C++, but Python is mostly uncharted territory for me. So if anyone spots some serious flaw or something that could be done alot better, feel free to point it out (politely ) and I will happily correct it. I'm mainly doing this because I have found the info on mincss which is out there not very beginner friendly. That also means that I may not always describe the most clever way of doing things for the sake of preserving understandability. Having said that: What Is It? A tool which strips your CSS files of unneeded stuff. You give it a URL, it will download that and parse it. Be careful though: If you have a CSS file used for several pages on your site, it will mark stuff that is not used on the URL you've given as unneeded. Completely logical of course, but important to keep in mind. What Do I Need Python2 (not Python3, as of 2013-OCT-08) mincss, obviously lxml (a Python extension) cssselect (also a Python extension) PhantomJS is optional I'm trusting you can manage to install this stuff yourself, if you're on a Linuxmachine it should be in the repositories (it is for Arch as of 2013-OCT-08). Let's Get Started Note: I'm doing this on a Linux machine, if you discover something I'm describing here not working on a Win PC, please let me know. Start a command terminal and change into the directory where you have stored mincss' files. Then start a Python2 console. On my Linux machine I simply type python2 into the console and hit return. If it's worked you should be greeted with a screen that has three > at its left: >>>Then, type in the following: >>> from mincss.processor import Processor>>> p = Processor()This will basically load mincss into the console (yes, I know: a simplification)and initialize an object named p of type Processor. After that, you give it an URL to download and instruct it to process whatever it has found there. >>> p.process_url('http://www.yourdomain.com/')>>> p.process()This will detect any inline CSS if I understand things correctly, I have not yettried this out myself. >>> p.inlines[]And this searches the document for linked CSS stylesheets and puts the resultsinto an array, starting at index 0 (so, the first stylesheet will be located at links[0], the second one at links[1] etc.). Don't mind the funky output. >>> p.links[<mincss.processor.LinkResult object at 0x10a3bbe50>, <mincss.processor.LinkResult object at 0x10a4d4e90>]Now you grab the first stylesheet and initialize it into object one(again, the name is arbitrary). If more than one stylesheet has been found, iterate through the array links[k] until you've initialized each stylesheet into an object (alternatively, you can of course grab one stylesheet, proceed further, then come back and initialize the second stylesheet into the same object etc.). >>> one = p.links[0]You can check which CSS sheet has been grabbed by entering this command, it willgive back the name and location of said stylesheet. >>> one.href'//d1ac1bzf3lrf3c.cloudfront.net/static/CACHE/css/c98c3dfc8525.css'Now for the interesting bit: This will give out the length of the stylesheetbefore it has been processed... >>> len(one.before)83108...and after processing: >>> len(one.after)10062By entering the following commands, you can print out the entire stylesheetsonto the screen if you wish: >>> one.after>>> one.beforeNow, this is nice and all, but what we would really like is generate a new, slimmed downstylesheet, wouldn't we? Thought so. Alright then, first we open a new filehandle for writing: (It is entirely possible mincss has some sort of integrated function/method for creating new, stripped down, files, but I have not been able to find anything on that so until informed otherwise I will presume it does not.) >>>filehandle=open('yournewfilename.css','w')>>>filehandle.write(one.after)>>>filehandle.close()And voilà, you should now have a new file of the name yournewfilename.css in your current directory.What Next? As said I'm no Python guru, and I only encountered mincss for the first time a day or so ago, so there's certainly some stuff missing from here, but it gets the job done which I think is probably at the top of many people's list. I've also read that it can do Javascript, but have not played around with that yet. If you wanted to automate this process, you could also write a script taking advantage of mincss, for an example see mincss' own examples here. Sources Official Site mincss Github Stackoverflow If you have any corrections, amendments, suggestions etc. feel free to post. Happy coding, -aw
-
Hello LTT! Instead of getting some work done from someone on freelancer.com I decided to do it on my own. I plan on making a website like: quibids.com - Java based. I haven't learn't much yet, just the basics. So I was wondering if I was thinking this out right, and if each Java based segment be its own class? index Nav PHP Jumbo PHP (How many users are online) Recent Auctions Java (Show most recent Complete Auctions) Recent Testimonials Java (Show most recent Testimonials) Footer PHP Current Auctions Java Displays all auctions that are currently being run in the order of Lowest Time to Highest time left. Auction Page Java More Details on that auction. Completed Auctions Java Displays all auctions marked "complete" in MySQL - Basically just a Giant list of the auctions. All Admin Pages related to the bidding are Java Login - Resister and Profile pages will also be Java So I was wondering if I was thinking this out right, and if each Java based segment(page) be its own class? Thanks for any help.
-
I'm setting up a personal server, and was wondering if there was any decent web app that I could use as a page to show shared video streamed from the server. Some sort of customisable layout and possibly user account/login would be nice, but i would mainly like something where, for example i could go to http://mywebsite.com/familyvideo and it would open a page showing previews of the videos, hopefully some soft of file structure (like per year) and then a video player to stream the video from. Does anyone know of any good pieces of software like that that i can run?
-
- web
- application
-
(and 3 more)
Tagged with:
-
foreach function without argument? Would it work? I already tried it and it worked! LOL but I'm kinda confuse why? So, I have a stdClass object which can be extracted using foreach right? for example: Array( [0] => stdClass Object ( [username] => derp [password] => derppass [email] => derpmail )) can be extracted like this: (assuming the array name is $array) foreach($array as $arr){ echo $arr->username . '<br>'; echo $arr->password. '<br>'; echo $arr->email. '<br>';} But what I did is I didn't put any argument in foreach and called it outside the function like this: foreach($array as $arr){ //empty lol}echo $arr->username;echo $arr->password;echo $arr->email; and it still worked! Dont have any error, but i think thats because my error_reporting setting is set to production value.... Is this safe to use?
-
Hello fellow programmers from Linustechtips! Long time no post... Straight to the point, is there any way I can display multiple entry as one. i know it's kinda hard to understand, thats why I cant find any answer on google lol.. But what I want is, for example, In my database, I want to display all user's name, but I have like, [john, ashley, david, derp, derp, john], I just want to display it as [ john, ashley, david, derp ].
-
I have written a program in PHP that will hopefully fix all the issues with the youtube sub box because it will download the list of subscriptions from the youtube API then load all the uploads by that user and rank them in time order (I intend to add other features too, but this is the most significant). However, while loading the subscriptions works fine (mainly because it is directly from the YT API), when I try to load the videos, I get a whole load of error messages. //get the subscriptions$subscriptions = $youtube -> subscriptions -> listSubscriptions ("snippet", array('mine' => 'true','maxResults' => 5, 'fields' => 'items/snippet,nextPageToken'));//fb($subscriptions);class videoClass { public $title = "An error has occured"; public $thumbUrl = ""; public $thumbUrlLng = ""; public $descriptionSh = "An error has occured"; public $timeP = "0000-00-00T00:00:00.000Z"; public $channel = "nobody"; public $channelUrl = "http://www.youtube.com/"; public $channelImg = "";}$latestVideos = array( new videoClass(), new videoCLass());//fb($latestVideos[0]);//parse the subscriptionsfor(;{ foreach ($subscriptions['items'] as $key => $val){ $channelName = $val['snippet']['title']; $channelId = $val['snippet']['resourceId']['channelId']; $uploadStock = xml2array(simplexml_load_file("http://gdata.youtube.com/feeds/api/users/$channelId/uploads?max-results=20&orderby=published")); $uploads = xml2array($uploadStock['entry']); fb($uploads); foreach ($uploads as $k => $v){ for ($l=0;$l<5;$l++){ if(strcmp($v['published'], $latestVideos[$l]->timeP)<0){//ERROR HERE: doesn't like the $latestVideos[0]->timeP - we're trying to get the property of a non object $video = new videoClass(); $video->timeP = $v['published']; $video->title = $v['title']; $video->descriptionSh = $v['content']; $video->channel = $channelName; array_splice($latestVideos,$l,0,$video); break; } } } // } break; //There would be more code here normally to make use of the loop but I have removed it for the sake of loading times and clarity} Notice: Undefined offset: 2 in A:\xampp\htdocs\ytph\index.php on line 68Notice: Trying to get property of non-object in A:\xampp\htdocs\ytph\index.php on line 68 array([0] =>array(['id'] =>'http://gdata.youtube.com/feeds/api/videos/V06f-oNDa40'['published'] =>'2013-11-09T06:04:43.000Z'['updated'] =>'2013-11-09T07:24:10.000Z'['category'] =>array(... 2 elements ... )['title'] =>'The WAN Show: GTX780Ti and r9 290, CoD + BF4 "criticism", and GUEST Steve Dotto - Nov 1, 2013'['content'] =>'After party : Sorry no official afterparty this week but Luke ran a super long unofficial afterparty on the http://www.twitch.tv/luke_lafr channel! Live Stre...'['link'] =>array(... 4 elements ... )['author'] =>array(... 2 elements ... )) array([0] =>videoClass(title ='An error has occured'thumbUrl =thumbUrlLng =descriptionSh ='An error has occured'timeP ='0000-00-00T00:00:00.000Z'channel ='nobody'channelUrl ='http://www.youtube.com/'channelImg =)[1] =>videoClass(title ='An error has occured'thumbUrl =thumbUrlLng =descriptionSh ='An error has occured'timeP ='0000-00-00T00:00:00.000Z'channel ='nobody'channelUrl ='http://www.youtube.com/'channelImg =))
- 6 replies
-
- php
- undefined offset
-
(and 3 more)
Tagged with:
-
I know there is a way. I just don't know how, but can anyone help me with this? Basically I want to change the database depending on the user. For example, when a customer logged in, the whole website will use user database, but when the admin logged in, the website will now use an admin database. Both database has the same tables and everything BUT, the data are different. Can I do something like this in the model: if(user){ public $useDbConfig = 'user';}elseif(admin){ public $useDbConfig = 'admin';}