Search Results

Search found 6517 results on 261 pages for 'localhost'.

Page 102/261 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • Why rails app is redirecting unexpectedly instead of matching the route?

    - by ruevaughn
    I asked this question earlier and thought it was fixed, but it's not. Previous question here My problem is I am trying to set my routes so that when I type in localhost:3000/sites/admin It should redirect to localhost:3000/en/sites/admin here is my routes.rb file scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do get "log_out" => "sessions#destroy", as: "log_out" get "log_in" => "sessions#new", as: "log_in" resources :sites, except: [:new, :edit, :index, :show, :update, :destroy, :create] do collection do get :home get :about_us get :faq get :discounts get :services get :contact_us get :admin get :posts end end resources :users resources :abouts resources :sessions resources :coupons resources :monthly_posts resources :reviews resources :categories do collection { post :sort } resources :children, :controller => :categories, :only => [:index, :new, :create, :new_subcategory] end resources :products do member do put :move_up put :move_down end end resources :faqs do collection { post :sort } end root :to => 'sites#home' match "/savesort" => 'sites#savesort' end match '', to: redirect("/#{I18n.default_locale}") match '*path', to: redirect("/#{I18n.default_locale}/%{path}") But as of right now, it redirects to /en/en/en/en/en/en/en/en/en/en/sites/admin (adds en until browser complains). Any thoughts why it keeps adding /en?

    Read the article

  • HTML relative links with URL Rewrite

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • Multiple HTTP requests using sockets in java

    - by codeomnitrix
    How could i send multiple http requests from my java program using sockets. actually i have tried as: import java.net.*; import java.io.*; class htmlPageFetch{ public static void main(String[] args){ try{ Socket s = new Socket("127.0.0.1", 80); DataInputStream dIn = new DataInputStream(s.getInputStream()); PrintWriter dOut = new PrintWriter(s.getOutputStream(), true); dOut.println("GET /mytesting/justCheck.html HTTP/1.1\r\nHost:localhost\r\n\r\n"); boolean more_data = true; String str; int i = 0; while(more_data){ str = dIn.readLine(); if(str==null){ //Now server has stopped sending data //So now write again the inputs dOut.println("GET /mytesting/justCheck1.html HTTP/1.1\r\nHost:localhost\r\n\r\n"); continue; } System.out.println(str); } }catch(IOException e){ } } } But when I send the request again it was not processed? Thank in advance.

    Read the article

  • Axis2 SOAP Envelope Header Information

    - by BigZig
    I'm consuming a web service that places an authentication token in the SOAP envelope header. It appears (through looking at the samples that came with the WS WSDL) that if the stub is generated in .NET, this header information is exposed through a member variable in the stub class. However, when I generate my Axis2 java stub using WSDL2Java it doesn't appear to be exposed anywhere. What is the correct way to extract this information from the SOAP envelope header? WSDL: http://www.vbar.com/zangelo/SecurityService.wsdl C# Sample: using System; using SignInSample.Security; // web service using SignInSample.Document; // web service namespace SignInSample { class SignInSampleClass { [STAThread] static void Main(string[] args) { // login to the Vault and set up the document service SecurityService secSvc = new SecurityService(); secSvc.Url = "http://localhost/AutodeskDM/Services/SecurityService.asmx"; secSvc.SecurityHeaderValue = new SignInSample.Security.SecurityHeader(); secSvc.SignIn("Administrator", "", "Vault"); DocumentServiceWse docSvc = new DocumentServiceWse(); docSvc.Url = "http://localhost/AutodeskDM/Services/DocumentService.asmx"; docSvc.SecurityHeaderValue = new SignInSample.Document.SecurityHeader(); docSvc.SecurityHeaderValue.Ticket = secSvc.SecurityHeaderValue.Ticket; docSvc.SecurityHeaderValue.UserId = secSvc.SecurityHeaderValue.UserId; } } } The sample illustrates what I'd like to do. Notice how the secSvc instance has a SecurityHeaderValue member variable that is populated after a successful secSvc.SignIn() invocation. Here's some relevant API documentation regarding the SignIn method: Although there is no return value, a successful sign in will populate the SecurityHeaderValue of the security service. The SecurityHeaderValue information is then used for other web service calls.

    Read the article

  • Artisan unable to access environment variables from $_ENV

    - by hansn
    Any artisan command I enter into the command line throws this error: $ php artisan <? return array( 'DB_HOSTNAME' => 'localhost', 'DB_USERNAME' => 'root', 'DB_NAME' => 'pc_booking', 'DB_PASSWORD' => 'secret', ); PHP Warning: Invalid argument supplied for foreach() in /home/martin/code/www/pc_backend/vendor/laravel/framework/src/Illuminate/Config/EnvironmentVariables.php on line 35 {"error":{"type":"ErrorException","message":"Undefined index: DB_HOSTNAME","file":"\/home\/martin\/code\/www\/pc_backend\/app\/config\/database.php","line":57}} This is only on my local development system, where I recently installed apache and php. On my production system on a shared host artisan commands work just fine. The prod system has it's own .env.php, but other than that the code should be identical. Relevant files: .env.local.php <? return array( 'DB_HOSTNAME' => 'localhost', 'DB_USERNAME' => 'root', 'DB_NAME' => 'pc_booking', 'DB_PASSWORD' => 'secret', ); app/config/database.php <?php return array( 'fetch' => PDO::FETCH_CLASS, 'default' => 'mysql', 'connections' => array( 'mysql' => array( 'driver' => 'mysql', 'host' => $_ENV['DB_HOSTNAME'], 'database' => $_ENV['DB_NAME'], 'username' => $_ENV['DB_USERNAME'], 'password' => $_ENV['DB_PASSWORD'], 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', ), ), 'migrations' => 'migrations', ), ); The $_ENV array is populated as expected on the website - the problem appears to be with artisan only.

    Read the article

  • gevent urllib is slow

    - by djay
    I've created a set of demos of a TCP server however my gevent examples are noticely slower. I'm sure must be how I compiled gevent but can't work out the problem. I'm using OSX leopard using fink compiled python 2.6 and 2.7. I've tried both the stable gevent and gevent 1.0b1 and it acts the same. The echo takes 5 seconds to respond, where the other examples take <1sec. If I remove the urllib call then the problem goes away. I put all the code in https://github.com/djay/geventechodemo To run the examples I'm using zc.buildout so to build $ python2.7 bootstrap.py $ bin/buildout To run the gevent example: $ bin/py geventecho3.py & [1] 80790 waiting for connection... $ telnet localhost 8080 Trying 127.0.0.1... ...connected from: ('127.0.0.1', 56588) Connected to localhost. Escape character is '^]'. hello echo: avast This will take 3-4 seconds to respond on my system. However the twisted example $ bin/py threadecho2.py or the twisted example $ bin/py twistedecho2.py Is less than 1s. Any idea what I'm doing wrong?

    Read the article

  • Why Response.Write behavior varies in the given scenario?

    - by Sri Kumar
    Hello All, When i POST the page using the following code, the Response.write("Hey") doesn't write the content ("Hello") to the parent page <form method="post" name="upload" enctype="multipart/form-data" action="http://localhost:2518/Web/CrossPage.aspx?cmd=getvalue" > <input type="file" name="filename" /> <input type="submit" value="Upload Data File" name="cmdSubmit" /> </form> But When i use following code , and POST the data, the Response.write("Hey") can be obtained in the parent page HttpWebRequest requestToSender = (HttpWebRequest)WebRequest.Create("http://localhost:2518/Web/CrossPage.aspx?cmd=getvalue"); requestToSender.Method = "POST"; requestToSender.ContentType = "multipart/form-data"; HttpWebResponse responseFromSender = (HttpWebResponse)requestToSender.GetResponse(); string fromSender = string.Empty; using (StreamReader responseReader = new StreamReader(responseFromSender.GetResponseStream())) { fromSender = responseReader.ReadToEnd(); } In the CrossPage.aspx i have the following code if (!Page.IsPostBack) { NameValueCollection postPageCollection = Request.Form; foreach (string name in postPageCollection.AllKeys) { Response.Write(name + " " + postPageCollection[name]); } HttpFileCollection postCollection = Request.Files; foreach (string name in postCollection.AllKeys) { HttpPostedFile aFile = postCollection[name]; aFile.SaveAs(Server.MapPath(".") + "/" + Path.GetFileName(aFile.FileName)); } Response.Write("Hey"); } I don't have any code in the Page_Load event of parent page.? What could be the cause? I need to write the "hey" to the Parent page using the first scenario. Both the application are of different domain. Edit: "Hey" would be from the CrossPage.aspx. I need to write this back to the Parent Page

    Read the article

  • Can one connection get details of another? Or, how can I get the most detailed pending transaction

    - by bob-the-destroyer
    Is there a Mysql statement which provides full details of any other open connection or user? For this particular case, on myisam tables specifically. Looking at Mysql's SHOW TABLE STATUS documentation, it's missing some very important information for my purpose. For example: remote odbc connection one is inserting several thousand records, which due to a slow connection speed can take up to an hour. Tcp connection two, using PHP on the server's localhost, is running select queries with aggregate functions on that data. Before allowing connection two to run those queries, I'd like connection two to first check to make sure there's no pending inserts on any other connection on those specific tables so it can instead wait until all data is available. If the table is currently being written to, I'd like to spit back to the user of connection two an approximation of how much longer to wait based on the number of pending inserts. Ideally by table, I'd like to get back using a query the timestamp when connection one began the write, total inserts left to be done, and total inserts already completed. Instead of insert counts, even knowing number of bytes written and left to write would work just fine here. Obviously since connection two is a tcp connection via a PHP script, all I can really use in that script is some sort of query. I suppose if I have to, since it is on localhost, I can exec() it if the only way is by a mysql command line option that outputs this info, but I'd rather not. I suppose I could simply update a custom-made transaction log before and after this massive insert task which the PHP script can check, but hopefully there's already a built-in Mysql feature I can take advantage of.

    Read the article

  • How to configure and run a fastcgi application using Lighthttpd...

    - by Airy
    Hi, i've installed Lighthttpd for windows and i'd created a simple program in c++ which uses fastcgi libraries. i'll post the code here... #include "fcgi_stdio.h" #include <stdlib.h> int count; void initialize(void) { count=0; } void main(void) { initialize(); while (FCGI_Accept() >= 0) { printf("Content-type: text/html\r\n" "\r\n" "<title>FastCGI Hello! (C, fcgi_stdio library)</title>" "<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>" "Request number %d running on host <i>%s</i>\n", ++count, getenv("SERVER_HOSTNAME")); } } I've spawned the fastcgi application in lighthttpd using the below configuration in lightttpd-inc.conf fastcgi.server = ( ".exe" => ( "" => ( "bin-path" => "D:\tinycgi.exe", "port" => 8080, "min-procs" => 1, "max-procs" => 1 ) ) ) while sending a request using the browser the server is responding with this message in the console 2009-02-18 16:08:34: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fa stcgi process died): pid: 0 socket: tcp:localhost:8080 2009-02-18 16:08:34: (mod_fastcgi.c.3325) response not received, request sent: 1 024 on socket: tcp:localhost:8080 for /new/tinycgi.exe , closing connection I think the fastcgi application is not spawned correctly. Thank you, Varun

    Read the article

  • HTML relative links on various domains

    - by Adam Kiss
    I have quickie: When you code/develop themes, how do you link to various files in your html/css code? Example: We at our firm use mostly <base target="http://whatever"> in our main template and then just <img src="./images/file.png"> in our html, "/category/page" as links and something alike in our css. However, when testing on different machines, we use ip address rather than localhost on main dev station of coder, so all base links don't work (because localhost goes to viewing machine, not coder's, in our network). Same thing happens when updating pages - on dev server, we have to edit base target, so browsing site won't take us to live site - this part is actually rather simple PHP (if ... echo else echo something else), but it still not solve problem of more coding-testing problems. So, my question is, how do YOU solve it? How do you use relative links, which basically don't care for what domain is the page on and don't care for url rewrite? (because ../images/ is different for / and different for /something/somethingElse/page)?

    Read the article

  • cannot modify header information puzzler

    - by outofmyleague_lucy
    hi im out of my league i have written what has now become identical code for two sites hosted on different servers. the first worked perfectly and i have therefore used it to compare the second to.from a login for i am directing to a loginaction.php when i include the db_connect.php ie <?php session_start(); include 'db_connect.php'; $user=$_POST['formUser'] $password=$_POST['formPassword']etc ? i am returning cannot modify header information header info already sent, but when i include the content of the db_connect ie <?php session_start(); $connect = mysql_connect("localhost", "user", "pass"); mysql_select_db(db_name, $connection); $user=$_POST['formUser'] $password=$_POST['formPassword']etc ? it works. any ideas? edit - requested error message Warning: Cannot modify header information - headers already sent by (output started at /home/avenncou/public_html/include/db_connect.php:4) in /home/avenncou/public_html/include/loginaction.php on line 14 at line 14 the is a header("Location: {$_SERVER["HTTP_REFERER"]}"); edit - requested db_connect.php <?php $connection = mysql_connect("localhost", "user", "pass");// or die ("Unable to connect!"); mysql_select_db("db", $connection);// or die ("Unable to select database!"); ?> that is all of it (dies commented out in case thats where the error was)!!!

    Read the article

  • I expect to see in the browswer "http://path/some_page.html" but instead it identifies with "http:/

    - by indiehacker
    I am developing with app engine SDK. I have a feeling this is much too basic a question so apologies ahead of time... A simple submit button doesnt work instead of just showing an alert box as expected it continues on afterwards and redirects me to the latest http-request, and I think this is because I dont understand how to tell the browser to recognize the proper URLs. Why does my browser say I am at the most recent http-request http://localhost:8080/putProjectInDB rather than the somepage.html that was actually served to the browser that I am currently looking at? How can I get the browser to recognize and show in its url spot the normal expected http://somepage.html ? Just in case, here are details of the specific problem which you might be able to ignore for answering the question: This hasnt been mattered for me until I just wanted to put into my .html a simple button that changes some stuff of the page without needing the server. The below code after displaying the alert box redirects me to the last server request http://localhost:8080/putProjectInDB instead of just staying in the same html page. in header: function MyFormCommands() { alert('Some Text'); } in body: <form onSubmit="MyFormCommands()" ><input type=submit ></form >

    Read the article

  • Ajax Request using jQuery in Rails

    - by Steve
    Hi... I am sending an Ajax Request using jQuery. What happens is that I am getting an "405 Method Not Allowed" Error. I am just posting a form, which would get the detail from the form and insert it into the DB. Just the usual stuff.I am using WEBrick that comes as default with the rails package. Can somebody please tell me how to fix this. This is the code that triggers the Ajax Request $.post($(this).attr("action") + ".js",$(this).serialize(),null,"script"); Response Headers Cache-Control no-cache Allow GET, PUT, DELETE Content-Type text/html; charset=utf-8 Content-Length 9502 Server WEBrick/1.3.1 (Ruby/1.9.1/2009-12-07) Date Wed, 02 Jun 2010 20:41:33 GMT Connection Keep-Alive Request Headers Host localhost:3000 User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept application/json, text/javascript, */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Content-Type application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With XMLHttpRequest Referer http://localhost:3000/viewspot/3 Content-Length 141 Pragma no-cache Cache-Control no-cache

    Read the article

  • Ajax request not receiving xml from Django

    - by amougeot
    I have a Django server which handles requests to a URL which will return some HTML for use in an image gallery. I can navigate to the URL and the browser will display the HTML that is returned, but I can't get that same HTML by doing an AJAX call (using jQuery) to the same URL. This is the view that generates the response: def gallery_images(request, gallery_name): return render_to_response('galleryimages.html', {'images': get_images_of_gallery(gallery_name)}, mimetype='text/xml') This is the 'galleryimages.html' template: {% for image in images %} <div id="{{image.name}}big"> <div class="actualImage" style="background-image:url({{image.image.name}});"> <h1>{{image.caption|safe}}</h1> </div> </div> {% endfor %} This is the jQuery call I am making: $("#allImages").load("http://localhost:8000/galleryimages/Web"); However, this loads nothing into my #allImages div. I've used firebug and ran jQuery's Ajax method .get("http://localhost:8000/galleryimages/Web") and firebug says that the response text is completely empty. When I check my Django server log, this is the entry I see for when I navigate to the URL manually, through my browser: [16/Jan/2010 17:34:10] "GET /galleryimages/Web HTTP/1.1" 200 215 This is the entry in the server log for when I make the AJAX call: [16/Jan/2010 17:36:19] "OPTIONS /galleryimages/Web HTTP/1.1" 200 215 Why does the AJAX request not get the xml that my Django page is serving?

    Read the article

  • What is the nicest way to parse this in C++ ?

    - by ereOn
    Hi, In my program, I have a list of "server address" in the following format: host[:port] The brackets here, indicate that the port is optional. host can be a hostname, an IPv4 or IPv6 address. port, if present can be a numeric port number or a service string (like: "http" or "ssh"). If port is present and host is an IPv6 address, host must be in "bracket-enclosed" notation (Example: [::1]) Here are some valid examples: localhost localhost:11211 127.0.0.1:http [::1]:11211 ::1 [::1] And an invalid example: ::1:80 // Invalid: Is this the IPv6 address ::1:80 and a default port, or the IPv6 address ::1 and the port 80 ? ::1:http // This is not ambigous, but for simplicity sake, let's consider this is forbidden as well. My goal is to separate such entries in two parts (obviously host and port). I don't care if either the host or port are invalid as long as they don't contain a : (290.234.34.34.5 is ok for host, it will be rejected in the next process); I just want to separate the two parts, or if there is no port part, to know it somehow. I tried to do something with std::stringstream but everything I come up to seems hacky and not really elegant. How would you do this in C++ ? I don't mind answers in C but C++ is prefered. Any boost solution is welcome as well. Thank you.

    Read the article

  • Multiple webroot folders with Jetty

    - by Lóránt Pintér
    I'm using Jetty (version 6.1.22) to service a Java web application. I would like to make Jetty look in two different folders for web resources. Take this layout: +- project1 | +- src | +- main | +- webapp | +- first.jsp | +- project2 +- src +- main +- webapp +- second.jsp I would like to make Jetty serve both URLs: http://localhost/web/first.jsp http://localhost/web/second.jsp I tried starting Jetty like this: Server server = new Server(); SocketConnector connector = new SocketConnector(); connector.setPort(80); server.setConnectors(new Connector[] { connector }); WebAppContext contextWeb1 = new WebAppContext(); contextWeb1.setContextPath("/web"); contextWeb1.setWar("project1/src/main/webapp"); server.addHandler(contextWeb1); WebAppContext contextWeb2 = new WebAppContext(); contextWeb2.setContextPath("/web"); contextWeb2.setWar("project2/src/main/webapp"); server.addHandler(contextWeb2); server.start(); But it only serves first.jsp, and it returns 404 for second.jsp. How can I get this to work?

    Read the article

  • How do i integrate paypal in my website? Java

    - by Nitesh Panchal
    Hello, I want to integrate paypal in my java web application. I saw that they offer many methods to accomplish this. But i want my visitors to remain on my site only. My friend told me that Paypal offers webservice. But i can't seem to find any documentation on Paypal site. If anybody could help me with this, i would be really very grateful. Please offer me the relevant links on Paypal where i could read and get my things done. Secondly, my friend also told me that we need to give location to paypal where my visitors would be redirected once paypal payment is complete. But i am confused. I am working on localhost. How would Paypal know about my localhost? I have already created my sandbox testing account. What should be my next step. Please explain me in detail. I don't know anything about Paypal. Once i created a demo application of Express checkout where they give a simple button of Pay Now and on clicking on it shopping cart etc appears. But now i want my visitors to stay on same website. Thanks in advance :)

    Read the article

  • Creation of zip folder in php

    - by Kishan
    I am trying to create a zip folder of my downloaded images. Here is my code. I am not getting any errors, but the zip is not getting downloaded.The code is getting compiled and I am getting the output till the display part of the current directory, but after that the code seems to go wrong somewhere and I am not able to get any Zip archive. <?php $conn_id=ftp_connect("localhost") or die("Could not connect"); ftp_login($conn_id,"kishan","ubuntu"); //login to ftp localhost echo "The current directory is " . ftp_pwd($conn_id); //display current directory ftp_chdir($conn_id,'/var/www/test1'); //changing to the directory where my images are downloaded. echo "<br/><p> Changing to directory" . ftp_pwd($conn_id); $file_folder="."; echo "<br/> The content of the directory is <br/>"; print_r(ftp_rawlist($conn_id,".")); // display the contents of the directory if(extension_loaded('zip')) //check whether extension is loaded { $zip=new ZipArchive(); $zip_name="a.zip"; //some name to my zip file if($zip->open($zip_name,ZIPARCHIVE::CREATE)!==TRUE) { $error="Sorry ZIP creation failed at this time"; } $contents=ftp_nlist($conn_id,"."); foreach($contents as $file) //addition of files to zip one-by-one { $zip->addFile($file_folder.$file); } $zip->close(); //seal the zip } if(file_exists($zip_name)) //Content-dispostion of my zip file { header('Content-type:application/zip'); header('Content-Disposition:attachment; filename="'.$zip_name.'"'); readfile($zip_name); unlink($zip_name); } ?>

    Read the article

  • Tomcat does not pick up the class file - the JSP file is not displayed

    - by blueSky
    I have a Java code which is a controller for a jsp page, called: HomeController.java. Code is as follows: @Controller public class HomeController { protected final transient Log log = LogFactory.getLog(getClass()); @RequestMapping(value = "/mypage") public String home() { System.out.println("HomeController: Passing through..."); return "home"; } } There is nothing especial in the jsp page: home.jsp. If I go to this url: http://localhost:8080/adcopyqueue/mypage I can view mypage and everything works fine. Also in the tomcat Dos page I can see the comment: HomeController: Passing through... As expected. Now under the same directory that I have HomeController.java, I've created another file called: LoginController.java. Following is the code: @Controller public class LoginController { protected final transient Log log = LogFactory.getLog(getClass()); @RequestMapping(value = "/loginpage") public String login() { System.out.println("LoginController: Passing through..."); return "login"; } } And under the same place which I have home.jsp, I've created login.jsp. Also under tomcat folders, LoginController.class exists under the same folder that HomeController.class exists and login.jsp exists under the same folder which home.jsp exists. But when I go to this url: http://localhost:8080/adcopyqueue/loginpage Nothing is displayed! I think tomcat does not pick up LoginController.class b/c on the tomcat Dos window, I do NOT see this comment: LoginController: Passing through... Instead I see following which I do not know what do they mean? [ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:34) got manifest [ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:36) manifest entrie s 8 The structure and the code for HomeController.java and LoginController.java plus the jsp files match. I have no idea why tomcat sees one of the files and not the other? Clean build did not help. Does anybody have any idea? Any help is greatly appraciated.

    Read the article

  • trouble connecting to MySql DB (PHP)

    - by user332817
    Hi I have the following PHP code to connect to my db. <?php ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); ?> however I get the following error: Warning: mysql_connect() [function.mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files (x86)\EasyPHP-5.3.2i\www\checklogin.php on line 11 Warning: mysql_connect() [function.mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Program Files (x86)\EasyPHP-5.3.2i\www\checklogin.php on line 11 Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files (x86)\EasyPHP-5.3.2i\www\checklogin.php on line 11 I am able to add a db/tables via phpmyadmin but I cant connect using php. here is a screenshot of my phpmyadmin page: http://img294.imageshack.us/img294/1589/sqls.jpg any help would be appreciated, thanks in advance.

    Read the article

  • Debug website on host from virtual machine

    - by Luchaguate
    I have a Windows 7 machine hosting a Windows 7 virtual machine. I am developing a web application using visual studio 2010 on my host machine. I want to run the application in debug mode and access my localhost server from a browser on the virtual machine. (The purpose of this is to be able to debug an application that uses Windows Authentication using different users without having to log off and on for different users on my host machine...) I am using a bridged connection for the virtual machine. I googled how to solve this problem and most of the threads that I found said that if I was using a bridged connection, I could access the server on the host machine by just entering the IP address of my host machine into the url in the browser of the virtual machine. I have tried some different urls using the IP but none of them have worked. As an example, suppose I run my web application in visual studio on my host machine and its url is http://localhost:62789/MyPage.aspx Assume also that I ran ipconfig in CommandPrompt on my host machine and found out that the IP address for my host machine is xxx.xxx.xxx.x. What url should I enter on the virtual machine to access my web application? Thanks in advance.

    Read the article

  • Error in FireFox Loading Images

    - by Brian
    Hello, Details of the app are: ASP.NET project, local web server, hosted in IIS locally, using latest FireFox, uses forms authentication. I'm getting a logon user name/pwd box when trying to access my local web server. Using the net panel in firebug, I see the issue is with an animated GIF, showing up as 401 unauthorized. I check the details and this is what I see for this URL: http://localhost/<virtual>/Images/loading.gif I'm getting the following: Response Headers: Server Microsoft-IIS/5.1 Date Thu, 17 Jun 2010 19:02:58 GMT WWW-Authenticate Negotiate NTLM Connection close Content-Length 4046 Content-Type text/html Request headers: Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET4.0E) Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 115 Connection keep-alive Referer <correct referer> Cookie ASP.NET_SessionId=ux4bt345qjz4p3u1wm1zgmez; .ASPXFormsAuth=33F12B444040827B8ABF154EE4EDE43B6CA532432EB846987B355097E00256DF0955C76A37BC593EAA961747BF1CC1D8949FF63C6F2CA69D77213EB15B4EDFAF57A83D9E1F88AB8D821C3A09C07EA2EE; .ASPROLES=qTFrGteJydYAE3118WGXbhJthTDdjdtuQ06t4bYVrM1BwIfcEHU1HhnEcs7TqSOaV-fIN5MH3uO57oNVWXDvrhkZ8gQuURuUk_K0TpoR-DEFXuF953Gl9aIilKAdV211jutMNQmhkt2rdPE2tEhHs3pz953fADxjAOyZl7K-AqNvMk3yqJshhKHhJIf-ALMhWIYlrrKy0WsYznUwh3WCtPfzEBD5XzmXU8HVMJ2-ArLjBISuegvSmxvK1PuXBPhoMRMi9Ynaw6xi9ypGk-R6uN0ljOMCGkB2-20WUlFuP0xWTfac_zCTDT00pbpnyjtygnM-LShOXTrZ_mhoRuXfKYEYSodNihwD6SRr19Nm-8uZ5BQ-W81svM17S2C0vc0FaxtiuAcN_vHcsN1OEJeCuVfRjeqzo9xWEViupP3Vh6aOcCm6yrftgw5x94piuCJO7tCfXjJAw5RVUWDBBWv5gmid171F0k-_XZ0CSv7Gm2Eai1BRfogAqQ_MV3tyPv7XVEyJXRXqYGlf1JpkfTW8S8On4E05v9gx9RcdnKHZebiOZwbP1_ho9nG7pMwXysbhjxtxwZ-zLx-v11_rhZw_i5m7iNcLtt4BbFU-sb_crzMpCKGywHIc452Zp1E0kx1Rfx-2eUnaiLiCfGed-QqelO88NYTpJHttGKEfhFrDgmaIXZPJRtuZ-GrS6t3Vla-8qDAVb1p6ovPwoVT4z4BhQyFsk542gDx-uQDw6D0B6zo7lXfcOjtolUxDcLbETsNlYsexZaxFpRSbw7M1ldwL_k92P9wLPlv9mw4NtyhXKJesMu7GjquZuoBN3hO00AqJEe1tKFFtfrvbE5ZH7uNu7myNdtlxRPe3WZe7qukbqHo1 Pragma no-cache Cache-Control no-cache Any ideas? Thanks.

    Read the article

  • Database class is not correctly connecting to my database.

    - by blerh
    I'm just venturing into the world of OOP so forgive me if this is a n00bish question. This is what I have on index.php: $dbObj = new Database(); $rsObj = new RS($dbObj); This is the Database class: class Database { private $dbHost; private $dbUser; private $dbPasswd; private $dbName; private $sqlCount; function __construct() { $this->dbHost = 'localhost'; $this->dbUser = 'root'; $this->dbPasswd = ''; $this->dbName = 'whatever'; $this->sqlCount = 0; } function connect() { $this->link = mysql_connect($this->db_host, $this->db_user, $this->db_passwd); if(!$this->link) $this->error(mysql_error()); $this->selection = mysql_select_db($this->db_name, $this->link); if(!$this->selection) $this->error(mysql_error()); } } I've shortened it to just the connect() method to simplify things. This is the RS class: class RS { private $username; private $password; function __construct($dbObj) { // We need to get an account from the db $dbObj->connect(); } } As you can probably see, I need to access and use the database class in my RS class. But I get this error when I load the page: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\includes\database.class.php on line 22 The thing is I have NO idea where it got the idea that it needs to use ODBC as a user... I've read up on doing this stuff and from what I can gather I am doing it correctly. Could anyone lend me a hand? Thank you.

    Read the article

  • Angularjs throws TypeError: Cannot read property 'indexOf' of undefined

    - by Ali
    I'm trying to debug the above code which I feel like this is very useful .< I can't even find what is wrong in my code and don't really know where to start since Angularjs still very new to me. I'm trying to localize Angularjs app. I know this is missing a lot of context in order to get a help, but I'm trying to see what information that I should give that would help on this debugging. I've gone through any indexOf in angularjs file and I can see few things is undefined but don't know if that would be helpful. So I've traced the problem here and this is what I have figured is the problem, but still counldn't figure out why... config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider.when('/:locale?/:username/badges', { templateUrl: '_partials/badges.html', controller: 'badges' }) .when('/:username/badges', { templateUrl: '_partials/badges.html', controller: 'badges' }) .when('/:username/teaching-resources', { templateUrl: '_partials/teaching-resources.html', controller: 'teachingResources' }) .when('/:username/makes', { templateUrl: '_partials/makes.html', controller: 'makes' }) .when('/:username/likes', { templateUrl: '_partials/likes.html', controller: 'likes' }) .when('/:username/events', { templateUrl: '_partials/events.html', controller: 'events' }) .when('/:username', { templateUrl: '_partials/badges.html', controller: 'badges' }); $routeProvider.otherwise({ redirectTo: '/error/404' }); The URL that I'm visiting for default page is: This will fail and throw the error. http://localhost:1969/en-US/user/someUserName This will work fine http://localhost:1969/user/someUserName UPDATE I figured out! This is the problem: $locationProvider.html5Mode(true); But why!?

    Read the article

  • GET is not working for firstResource Rest example

    - by Anandan
    Hi, I am newbie to rest. I am using the following code example to understand the RESTlet. http://www.restlet.org/documentation/1.1/firstResource I am using RESTClient addon to firefox for testing. When i do GET on http://localhost/rest, i get a response "ok". But when i do GET on http://localhost/items, I get an error "404 Not found" Here's the sample code: public synchronized Restlet createRoot() { Router router = new Router(getContext()); router.attach("/items", ItemsResource.class); router.attach("/items/{itemName}", ItemResource.class); Restlet restlet = new Restlet() { @Override public void handle(Request request, Response response) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("ok"); response.setEntity(new StringRepresentation(stringBuilder .toString(), MediaType.TEXT_HTML)); } }; router.attach("/rest", restlet); return router; } ItemResource is same as provided in the link. and I use tomcat to run the servlet. Why am I getting the "Not found" error? Am i missing something here? Thanks & Regards, Anandan

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >