Jump to content

Search the Community

Showing results for tags 'localhost'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 5 results

  1. I am trying to set a cookie when there is no cookie from my website found on the user's PC, but the following line of code doesn't work inside a function: $cookiename = "test"; $cookievalue = "tests"; setcookie($cookiename, $cookievalue, false, "/", "localhost"); It does work however if it is placed outside of the function. For exampe, the code above works, but the next code doesn't: $cookiename = "test"; $cookievalue = "tests"; function addCookie() { setcookie($cookiename, $cookievalue, false, "/", "localhost"); } addCookie();
  2. Hi i am using HTML5 Server-Sent Events Actually i need to show notification ( new record enter and which are unread ) thats when any new record is insert in database ( php / mysql ) So for testing purpose i just tried with count of total row. but getting below error message in my localhost : Firefox can't establish a connection to the server at http://localhost/project/folder/servevent/demo_sse.php.line is : var source = new EventSource("demo_sse.php"); WHAT I HAVE TRIED : index.php <script>if(typeof(EventSource) !== "undefined") {var source = new EventSource("demo_sse.php");source.onmessage = function(event) {document.getElementById("result").innerHTML = event.data;};} else {document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";}</script> <div id="result"></div> demo_sse.php <?phpheader('Content-Type: text/event-stream');header('Cache-Control: no-cache');$db = mysql_connect("localhost", "root", ""); // your host, user, passwordif(!$db) { echo mysql_error(); }$select_db = mysql_select_db("testdatase"); // database nameif(!$select_db) { echo mysql_error(); }$time = " SELECT count( id ) AS ct FROM `product` ";$result = mysql_query($time);$resa = mysql_fetch_assoc($result);echo $resa['ct'];flush();?> please let me know what going wrong. I know for notification we can use Ajax with some interval time , but i don't want such thing. As i have N number of records and which may slow my resources.
  3. I am making a file upload system. The user chooses where to upload using the dynamic drop down list. And this is the problem I am facing right now. This is my form. <form action="uploader.php" method="POST" enctype="multipart/form-data" name="uploads"> <label for="file">Choose a file: </label> <input type="file" name="userfile" id="userfile"><br/><br/> <select id="text-one" name="one"> <option selected value="base">Select Department</option> <option value="CSE" name="cse">Computer Science Engineering</option> <option value="ECE" name="ece">Electronics & Communication Engineering</option> <option value="MECH" name="mech">Mechanical Engineering</option> </select> <br /><br/> <select id="text-two" name="two"> <option>Select Semester</option> </select> <br /><br/> <select id="text-three" name="three"> <option>Select Subject</option> </select> <br/><br/> <button class ="btn btn-primary" button type="submit" name="upload" value="Upload" onClick="val()">Upload</button> </form> And this is my other php file to which it is linked. <?phpif(isset($_POST['upload'])){ $path1=$_POST['one']."/"; $path2=$_POST['two']."/"; $path3=$_POST['three']."/"; $upload_path=$path1.$path2.$path3;}else{ echo "Select a Subject"; echo "<br>";}$allowed_filetypes = array('.doc','.docx','.jpg','.jpeg','.png','.ppt','.pptx','.xls','.xlsx','.pdf','.txt','.zip','.rar');$max_filesize = 20000000;$filename = $_FILES['userfile']['name'];$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);if(!in_array($ext,$allowed_filetypes)) die("<script LANGUAGE='JavaScript'> window.alert('You cannot upload the following type of file!') window.location.href='upload.php'; </SCRIPT>");if(filesize($_FILES['userfile']['size']) > $max_filesize) die("<script LANGUAGE='JavaScript'> window.alert('The file you attempted to upload is too large!') window.location.href='upload.php'; </SCRIPT>");if(!is_writable($upload_path)) die("<script LANGUAGE='JavaScript'> window.alert('You cannot upload to the specified directory!') window.location.href='upload.php'; </SCRIPT>");if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename)) echo ("<script LANGUAGE='JavaScript'> window.alert('Your file has been uploaded successfully') window.location.href='upload.php'; </SCRIPT>");else echo ("<script LANGUAGE='JavaScript'> window.alert('There was an error during the file upload!') window.location.href='upload.php'; </SCRIPT>");?> I have edited the phpini file with the following settings and also made a .htaccess file in the php folder.upload_max_filesize 25M post_max_size 25M memory_limit 64MBut when I intentionally upload a file greater than 25 MB, I get the error as given in the title. Also, considering the max file size is being violated, it does not give the error related to the file size, i.e The file you attempted to upload is too large, it says You cannot upload the following type of file. And in the background that post length warning thing comes.Please help me with this. I am on my localhost.
  4. AskSMBR

    Xampp Mysql

    Asalam-o-aliqum or Hello I am facing problem when connect MySQL database in XAMPP localhost if you know the answer plz replay Thanks. I have write "Asalam-o-aliqum" which Muslims says when meet someone. instead of hello.
  5. Hi! Background:I am maintaining a Java application where I create a http server (using the class org.apache.http.protocol.HttpService). The http server creates a socket on port 6060. From an Ajax script executed in a browser on the same machine, a xmlhttp request is sent to localthost port 6060. The request is transmitted to the Java application and and response is sent, works fine. As long as the solution is executed on a client machine (desktop computer). The Java application executes in ONE instance since it is ONE machine with ONE user. The application is designed to handle requests from one user only. Problem:When the solution is executed on a terminal server (through Windows Remote Desktop Connection), each user will start a new instance of the Java application, that is if there are five users logged in the the terminal server, there will be five running instances of the Java application. The first started instance allocates port 6060 on localhost. But when the following instances tries to allocate port 6060 on localhost, it fails since it is already allocated by the first instance. I expected this to work, since I thought that each user on a terminal server executed in a own session with a memory and ports of its own, but obviously this is not the case. I have however heard that it should be possible to allocate a "virtual" port (i.e. unique for my session) instead of a machine physical port. Does anyone have a clue about how to solve this, I am in urgent need of advises... I insert parts of my Java code where I create the http server: ServerSocket mSocket = new ServerSocket( 6060);HttpParams mHttpParams = new SyncBasicHttpParams();mHttpParams .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, DEFAULT_TIMOUT ) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, DEFAULT_BUFFER_SIZE ) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false ) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true ) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1") .setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, "UTF-8"); // Set up the HTTP protocol processorHttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] { new ResponseDate(), new ResponseServer(), new ResponseContent(), new ResponseConnControl() }); // Set up request handlersHttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();reqistry.register("*", new GadgetRequestHandler( mGadgetIntegrator )); // Set up the HTTP HttpService mService = new HttpService(httpproc, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory(),reqistry,mHttpParams); Thanks!
×
×
  • Create New...