Jump to content

Search the Community

Showing results for tags 'java'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

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


Age


Donation Link

  1. Hi again folks, I have a single Form which allows user to create a new Gift Voucher record. It is split into 3 input areas Voucher Details, Payment Details and Delivery Details. I want to add a button on the Payment details section which when activated will copy some of the entered fields from the Payment section to some of the fields in the Delivery section as follows: - FROM PAYMENT SECTION TO DELIVERY SECTION PurchaserName DeliveryName PAddressLine1 DAddressLine1 PAddressLine2 DAddressLine2 PCounty DCounty PPostCode DPostCode I am using a Code Building product called PHP Runner which when you add a button gives you a properties widget as per attachment in which to place your bespoke code. Hope you guys can help, Al the best, Carl.
  2. Hello I heard that some websites use Java or C++ or Python with PHP in the same time, if some know how it's done please answer these 3 questions: 1. How can we run PHP and Java or C++ or Python in the same time. 2. How the variables are passed between them. 3. Wich one is better, Java or C++ or Python . Thanks all.
  3. I have a form that an agent can fill out and then hit send and it will auto generate an email for them. I had it working and wanted to update to dynamic drop downs. now my clear and send buttons no longer work. <head> <title>Research / Serviceability Email</title> <style type="text/css"> .style166 {color: #FFFFFF} </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> function clearresearch() { document.getElementById("text-one").selectedIndex = "base"; document.getElementById('esl').value=''; document.getElementById('account').value=''; document.getElementById('name').value=''; document.getElementById('address').value=''; document.getElementById('er').value=''; document.getElementById('issue').value=''; document.getElementById("text-two").selectedIndex = ""; } function mailresearch() { if (document.getElementById('txet-one').value="research") { var esl = document.getElementById('esl').value; var acct = document.getElementById('account').value; var name = document.getElementById('name').value; var address = document.getElementById('address').value; var er = document.getElementById('er').value; var issue = document.getElementById('issue').value; var type = document.getElementById('type').value; var sendmail = 'mailto:Email Address 1' + '?subject=' + esl + " / " + "ER" + er + " / " + type + '&body=' + "Account Number: " + acct + "%0D%0A" + "Customer Name: " + name + "%0D%0A" + "Customer Address: " + address + "%0D%0A" + "ER Ticket Number and Type: " + er + " / " + type + "%0D%0A%0D%0A" + "Description of Issue:" + "%0D%0A%0D%0A" + issue + "%0D%0A%0D%0A"; win = window.open(sendmail, 'emailWindow'); if (win && win.open && !win.closed) win.close(); } else { var esl = document.getElementById('esl').value; var acct = document.getElementById('account').value; var name = document.getElementById('name').value; var address = document.getElementById('address').value; var er = document.getElementById('er').value; var issue = document.getElementById('issue').value; var type = document.getElementById('type').value; var sendmail = 'mailto:Email Address2' + '?subject=' + esl + " / " + "ER" + er + " / " + type + '&body=' + "Account Number: " + acct + "%0D%0A" + "Customer Name: " + name + "%0D%0A" + "Customer Address: " + address + "%0D%0A" + "ER Ticket Number and Type: " + er + " / " + type + "%0D%0A%0D%0A" + "Description of Issue:" + "%0D%0A%0D%0A" + issue + "%0D%0A%0D%0A"; win = window.open(sendmail, 'emailWindow'); if (win && win.open && !win.closed) win.close(); } } $(function() { $("#text-one").change(function() { $("#text-two").load("textdata/" + $(this).val() + ".txt"); }); }); </script> </head> <body> <form name="research"> <table id="callnotesr"> <tbody> <tr> <td bgcolor="#0000FF"><div align="center" class="style166">Research / Serviceability Email</div></td> </tr> <tr><td width="235" rowspan="5" valign="top" style="border:1px solid black; border-color:black;"> <div> <div align="">Research or Serviceability</div> <select id="text-one"> <option selected value="base">Please Select</option> <option value="research">Research</option> <option value="service">Serviceability</option> </select> </div> <div> <div align="">ESL Ticket Number</div> <div align=""> <input type="text" class="style44" id="esl" size="60" value="" > </div> <div> <div align="">Account Number</div> <div align=""> <input type="text" class="style44" id="account" size="60" value="" > </div> <div> <div align="">Customer Name</div> <div align=""> <input type="text" class="style44" id="name" size="60" value=""> </div> <div> <div align="">Customer Address</div> <div align=""> <input type="text" class="style44" id="address" size="60" value=""> </div> <div> <div align="">ER Ticket Number</div> <div align=""> <input type="text" class="style44" id="er" size="60" value=""> </div> <div> <div align="">ER Ticket Type</div> <select id="text-two"> <option>Please choose from above</option> </select> </div> <div> <div align="">Description of Issue</div> <div align="center"> <textarea cols="50" rows="10" id="issue" ></textarea> </div> <br /> <div> </form> <div align="center" class="style44"> <button name="clearresearch" type="button" class="style115" id="clearresearch" onclick="clearresearch()" value="Clear">Clear</button> <button name="mail" type="button" class="style115 " id="mail" onclick="mailresearch()" value="Send">Send</button> </div> </td> </tr></tbody></table> </body> </html>
  4. Hello, So I need to convert PHP code to JSP/Java. I really don't understand PHP and would like an explanation as to what this code is doing. So I can convert it, any help would be great thank you it's only 4 lines of code sitemap.php Attached PHP file
  5. i can do stuff in html, php, flash, java and server developement and work for more then 8 years in different segments for webprogramming. german.
  6. We are a Silicon Valley based startup and 30-60 days away from launch. We are seeking a partner and outstanding web developer to be responsible for developing and implementing innovative and secure web application for our eCommerce business. The person would work closely with our Marketing, Sales, Engineering and IT members to develop specifications and make recommendations on the use of new and emerging technologies and then implement those recommendations. Design, Programming, and database administration are all elements of this position. This person must have following experience and skills: - HTML5, XHTML, CSS3, PHP, and JavaScript, AJAX, jQuery, responsive frameworks and other technologies - command of web standards, CSS-layouts, DOM scripting, cross-browser compatibility & browser degradation strategies - working with the various JavaScript and PHP libraries - understanding of dynamic or active web content and the use of CGI, Perl, Java, XML and JSON - experience with SQL database (MySQL) - little understanding of Unix/Linux system and Apache web-server administration - experience working with Google Webmaster Tools, Google Analytics, and Google Custom Search - develop responsive and mobile websites
  7. Database Structure: email (Primary Key) - varchar(50) // Email address fname - varchar(30) // First name lname - varchar(30) // Last name pw - varchar(20) // Password id - varchar(50) // Session ID (Unix time value for valid session) I need help validating user login and session time for the code in php. main.php index.php
  8. Hello there, I have 3 years experience as php, js, css, html, jquery and java/android, worked with various CMS and Frameworks, find more in my portfolio:http://netkurator.ru/en-portfolio/ . Looking for long term and partial-time job. Hourly rate from 8$. Prefer to work through Odesk. With respect Roman.
  9. hi is there any way to create an .edu email address with php ? without a .edu website ?
  10. Hello friends, My name Stefany and I am a computer programmer. Over the past 2 years I have created 15 websites, the most prominent being: 1. Social Network for the Texas Tech University; 2. Web-shop for a 4d Go player; 3. Personal history blog; 4. Another web-shop for a Bulgarian company; 5. Homepage for a Bulgarian national newspaper; My major skills include: Front end - XHTML, CSS, JavaScript Back end - PHP, Perl, AJAX Databases - MySQL, SQLite, MariaDB CMS - WordPress Other - XML, REST, SOAP Frameworks - CodeIgniter E-Commerce platforms - OsCommerce, Magento I am truly confident to create any kind of website, web application or script. Just send me a message, thank you. Portfolio with all the websites I had created so far and my programming blog - www.dyulgerova.info Github - https://github.com/Stefany93?tab=repositories CV - www.dyulgerova.info/cv.pdf Email: stefany@dyulgerova.info Skype - age_of_empires3 Thank you very much! Stefany
  11. Does anyone know if it is possible or impossible to run ANT via PHP as if it were run from the command line? I am running into what look like permissions issues, but it may just as likely or additionally be a limitation of PHP or my configuration of PHP. I am using PHP 5.3 on Windows Server 2008 and IIS 7. exec('"C:\Program Files\ANT\bin\ant" -f build.xml >logfile.txt 2>&1'); logfile.txt contains: Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. Any assistance or insight you could offer would be lovely.
  12. Hello everyone, i have a quiestion regarding a bug fixing. We have an online website and right now we are have a bug issue in one of the pages. Basically when we tried to to make changes in the page from the admin panel, and then click "save" we are redirected to the page and all the changes we have made are now blank and there are no changes to the front end. I am running into the issue that nothing can be edited because it will not be saved in the end. Any ideas how to remedy this?
  13. hi guys, i have problem write java class in php via php java bridge. i try write this java code in php: http://www.lucenetutorial.com/lucene-in-5-minutes.html when i found this line: IndexReader reader = DirectoryReader.open(index); i dont get it how to write it in php. i've tried but error result. in DirectoryReader class, i found: public static DirectoryReader open(Directory directory) throws IOException { return StandardDirectoryReader.open(directory, null, 1); } but, when it be like this: Query q = new QueryParser(Version.LUCENE_40, "content", analyzer).parse(querystr); i write in php like below: $query = new Query\QueryParser($version->LUCENE_43,'content',$analyzer); $query->parse($querystr); it's no error. so, could you help me how to write it in php?? thanks in advance.
  14. hey guys new to the forum i know bits and pieces of programming but i cannot for the life of me get this code working i cannot put the whole code out there for infringment reasons so here is what i can show Thanks guys <?php require_once (dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'bootstrap.php'); $chatroom_id = get_var("id"); ?> <script type="text/javascript"> var dc_chatroom_id = <?php echo $chatroom_id = document.getElementById('id'); ?>; <!-- if i take this out ^^^^^ and put just 1 thru 6 one of the chatrooms work i have initially 6 rooms so i need to find a way to make this work. --!> </script> <div data-role="navbar" data-theme="a"> <ul> <li id="1"><a href="#room" data-role = 'button' data-transition="fade" data-theme="a">The Hangout</a> </li> </ul> <ul> <li id="2"><a href="#room" data-role = 'button' data-transition="fade" data-theme="a">Electronics Chat</a></li> </ul>
  15. need help java script below not working, its supposed to allow only the word "Resolved" and "Re-assigned" in one of my text area, so if the user enter other values, the form will not be submitted... function checkAllowedWords(){ var allowedWords, textString, textArray, length, word; allowedWords=["Resolved","Re-assigned"]; textString= document.getElementById("$Status").value; //replace the "text-area-element-id" with your actual id for that textarea textArray=str.split(" "); //if comma separated values are provided use "," instead of " " length = textArray.length; word = null; for (var i = 0; i < length; i++) { word = textArray[i]; if (allowedWords.indexOf(word, 0) === -1) { //indexOf() returns the index of the first "word" value found in the "allowedWords" array, and returns -1 if the value was not found in array alert(word + " is not allowed! The accepted values are: " + allowedWords.toString()); //This will popup an alert message for your testing purposes, you can implement anything you wish here to let the user know what's going on } } }
  16. Guys, need some help.. Right now i have a login page with select box option.. I have create several other page (admin_page.php, student_page.php, parents_page.php) to link with the option in the select box.. So what im asking now is how to link the selected option to their page respectively with the username and pass correct? Here is the login page looks like.. http://i272.photobucket.com/albums/jj178/r1nk_2008/lol_zpsa54db359.png <html> <head> <title> Login Form </title> </head> <body> <div style="width: 200px; margin: 200px auto 0 auto;"> <form method='post' action='login.php'> <table width='400' border='5' align='center'> <tr> <td align='center' colspan='5'><h1>Member Login</h1></td> </tr> <tr> <td align='center'>Username:</td> <td><input type='text' name='username' /></td> </tr> <tr> <td align='center'>Password:</td> <td><input type='password' name='pass' /></td> </tr> <tr> <td></td> <td align='left'> <select name="type" id="type"> <option value="0" selected="selected">Select user type</option> <option value="admin">Admin</option> <option value="student">Student</option> <option value="lecturer">Lecturer</option> <option value="parents">Parents</option> </select> </td> </tr> <tr> <td colspan='5' align='center'><input type='submit' name='login' value='Log In' /></td> </tr> </table> </form> </body> </html> <?php mysql_connect("localhost","root",""); mysql_select_db("student_attendance"); if(isset($_POST['login'])){ $username = $_POST['username']; $password = $_POST['pass']; $type = $_POST['type']; $check_user = "select * from users where username='$username' AND pass='$password' AND type='$type'"; $run = mysql_query($check_user); if(mysql_num_rows($run)>0){ echo "<script>window.open('admin_page.php','_self')</script>"; } else { echo "<script>alert('Username, password or user type is incorrect!')</script>"; } } ?>
  17. Not sure how to go about this task but I imagine it requires some sort of foreach loop I have a drop down list populated by a label called LST_Type, this table only exists to provide options for this dropdown list The value selected on the dropdown menu gets written to a table called "assets". when the users clicks away from the form (using ajax) Here is what I need to happen: On page load the dropdown list need its default option to be whatever the current value of the record is in the "asset" table. As the only way you can insert data into this field is via the dropdown list it will always be somethig from the "LST_Type" table The reason is that the data is written to the fields when you click away from the input boxes and unless you are editing the "Type" record it updates it to its default selection. hope this makes sense here is my code: <tr id="<?php echo $id; ?>" class="edit_tr"> <!-- Title Colum --><td class="style4" style="font-size:14px;width:200; height:35px; class="edit_td"> Type: </td> <td style="font-size:14px;width:270px;border:solid 0px #000;padding:0px; class="edit_td"> <span style="color:#0066CC;" id="type1_<?php echo $id; ?>" class="text"><?php echo $Type; ?></span> <!-- ***************************************START - This Is the dropdown menu script *********************************************** --> <script type="text/javascript"> function OnDropDownChange2(dropDown) { var selectedValue = dropDown.options[dropDown.selectedIndex].value; document.getElementById("type1_input_<?php echo $id; ?>").value = selectedValue; } </script> <select name = "MYtype" id="type1_input_<?php echo $id; ?>" class="editbox" onChange="OnDropDownChange2(this);">> <?php $sql = mysql_query("SELECT Type FROM LST_Type"); while ($row = mysql_fetch_array($sql)){ echo "<option value='" . $row['Type'] . "'>" . $row['Type'] . "</option>"; } ?> </select> <input type="text" value="<?php echo $Type; ?>" class="editbox" id="type1_input_<?php echo $id; ?>" /> /> <!-- ***************************************END *********************************************** -->
  18. Hi all , i am newbie in java. i am getting error not sure about this when you select option two after running this code. this error will occur please help Error: exception in thread “main” Java.lang.nullPointerException error? here is my code import java.util.*; class Person { String name; int phoneNumber; } class Student extends Person { String rollNo; double CGPA; public Object getRollNo; public void input() { System.out.print("Enter rollNo and CGPA: "); Scanner in = new Scanner(System.in); rollNo = in.next(); CGPA = in.nextFloat(); } public void output() { System.out.println(" Student Details " ); System.out.println("\n============" ); System.out.println("Roll No: " + rollNo + "\nCGPA: " + CGPA); } public String getRollNo() { return rollNo; } } public class AddressBook { public static void main(String args[]) { int choice = 3; AddressBook addressBook= new AddressBook(3); System.out.println("\n1.Press 1 to Add Contact."); System.out.println("\n2.Press 2 to Search."); System.out.println("\n3.Exit."); System.out.println("\n=========================================="); System.out.print("Enter your choice: "); Scanner in = new Scanner(System.in); int choice1 = in.nextInt(); while (choice1 != 3) { //try { if (choice1 == 1) { addressBook.AddContact(); } else if (choice1 == 2) { addressBook.Search(); } else if (choice1 == 3) { System.out.print("Exting..."); } else { System.out.print("Please enter a valid menu option."); } /*} catch (ArrayIndexOutOfBoundsException e) { System.out.print("Please enter a valid menu option."); } */ System.out.println("\n1.Press 1 to Add Contact."); System.out.println("\n2.Press 2 to Search."); System.out.println("\n3.Exit."); System.out.println("\n=========================================="); System.out.print("Enter your choice: "); choice1 = in.nextInt(); } } int sizeOfAddressBook; int currentRecord; //Person[] record; // <-- Defined a variable which will be an array of Person objects Person[] record = new Person[10]; AddressBook(int size) { sizeOfAddressBook = size; for (int iter = 0; iter < sizeOfAddressBook; iter++) { record[iter] = new Person(); // error } currentRecord = 0; } void AddContact() { try { Student student = new Student(); student.input(); record[currentRecord++] = student; } catch(ArrayIndexOutOfBoundsException e1) { System.out.println("No more free place exist in array record!"); } } void Search() { System.out.print("Enter rollNo: "); Scanner in = new Scanner(System.in); String no = in.next(); Student stud = new Student(); // me for (int iter = 0; iter < sizeOfAddressBook; iter++) { if (record[iter] instanceof Student) { stud = (Student) record[iter]; try{ if (stud.getRollNo.equals(no)) { stud.output(); return; } } catch(NullPointerException e) { e.printStackTrace(); System.out.println("exception details" + e); } } } System.out.println("Student is not found!"); } }
  19. Hi i m getting problem in uploading files to my site i am not expert in java i m novice whenever i trying to upload files via jupload it give me error ClassNotFoundException wjhk.jupload2JUploadApplet some days back it was working fine and its w-script which use jupload to upload bulk wallpapers i dont know how to deal with this problem please help me
  20. I have this dependent radio and dropdown box, it works fine. Now I am trying to validate and its failing to validate. When i click on a radio button it should display "select a make" and If i dont select anything it should prompt me to select something rather than just submit. Also when i try to reset, what ever ive selected does not clear away. Any help will be great. Thanks in advance. Original code is from http://forums.phpfreaks.com/topic/145947-radio-button-to-change-drop-down-fields/ <html> <head> </head> <body> <form id="formname" name="formname" method="post" action="#" onsubmit="return validate()"> Make:<br> <input type="radio" name="make" value="Chrysler" onclick="changeMake(this.value);"> Chrysler<br /> <input type="radio" name="make" value="Ford" onclick="changeMake(this.value);"> Ford<br /> <input type="radio" name="make" value="GMC" onclick="changeMake(this.value);"> GMC<br /> <br> Model: <select name="model" id="model" onchange="changeModel(this.value);" disabled="disabled"> <option> -- Select a Make -- </option> </select> <br><br> Output: <span id="output"></span> <input type="reset"> <input type="submit"> </form> </body> <script type="text/javascript"> var models = new Array(); models['Chrysler'] = ['Pacifica', 'PT Cruiser', 'Sebring']; models['Ford'] = ['Ranger', 'Taurus', 'Mustang']; models['GMC'] = ['Acadia', 'Sierra', 'Yukon']; function changeMake(make) { var modelList = models[make]; changeSelect('model', modelList, modelList); document.getElementById('model').disabled = false; document.getElementById('model').onchange(); } function changeModel(modelValue) { document.getElementById('output').innerHTML = modelValue; return; } function changeSelect(fieldID, newValues, newOptions) { selectField = document.getElementById(fieldID); selectField.options.length = 0; if (newValues && newOptions) { for (i=0; i<newValues.length; i++) { selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]); } } } </script> </html>
  21. I want to make a form that will display different options on the second item, depending on the users input on the item before... I understand this is usually accomplished in javascript/jquery, however with my limited knowledge of javascript and jquery I was considering using a selection of iframes loading in php content, this is clearly a really inefficient method of achieving my goal, however, is it even possible to put Form elements into an iFrame? Or should I seek out the jquery?
  22. Hi all, I am working with a drop down to auto populate a textarea with preset fields / lines. The issue I keep having is the formatting to the text being populated has no lines/breaks to it. Below is the current java script snip it and the form as it stands. I am looking to find if there would be a better method to doing this, including creating a php form utlizing ajax to pull the information. Thoughts? Javascript: <script type="text/javascript">function updateTextBox(val) { if(val == "1") { document.forms['Form'].elements['TextBox'].value = "Line 1, Line 2, Line 3, Line 4";<--- In theory should display as entered, however this does not occur on any line break/Also /n/p/br/&nbsp do not work to adding lines/breaks. } else if(val == "2") { document.forms['Form'].elements['TextBox'].value = "Line 1 &nbsp Line 2"; } } </script> Form: <form name="Form"> <select onchange='updateTextBox(this.value)'> <option value=""></option> <option value="1">Test</option> <option value="2">Test2</option> </select> <tr> <td> <div align="left"><span id="copy"> <textarea name="TextBox" cols="29" rows="30" style="font-family: Verdana" class="size12"></textarea> <br /> </span></div> <table width="20%" border="0" align="left"> <tr><td><input name="Button" type="button" onclick="javascript:selectcopy('Form.textbox')" value="Copy Notes" /></td></tr> <tr><td><input name="RESET" type="RESET" value="Clear Notes" /></td></tr> </table> </div>
  23. how to insert google map on website I want to use below code for my google map, which is posted on internet and easy to understand, but it doesn't works. I hae get API key but when I replace the original key, I don't know which part of code I need to modified. how to get a GLatlng cooridinates cooresponding with my API key. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...tml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps Javascript API Example</title> <script src="http://maps.google.c...v=2&key=abcdefg" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(37.4419, -122.1419), 13); } } //]]> </script> </head> <body onload="load()" onunload="GUnload()"> <div id="map" style="width: 500px; height: 300px"></div> </body> </html> I think I only need to replace this two parts in red color, is there any more place that I should modified. I think this is the simple way that I could use google map on my website. pls come up with better ways if you could. thanks.
  24. Hello everyone, I have this idea for a website that I can't seem to solve. I created an intro page where there's a username and a password to type and two buttons, a login button and a register button. What I wanted to do is when the login button is pressed it compares the username and the password with database entries, if they're available, it would redirect the client to homepage. If not, the lightbox would appear for registration. The code to my intro page is: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title> RYNC - Rent Your Car Now</title> <style type="text/css"> @import "Dialog/DescriptionDialog.css"; @import "Dialog/styles.css"; </style> <style> body { background: url(../Images/Bgcolor.jpg); background-size: 100%; background-position: top center; background-repeat: no-repeat; } </style> </script> <script type="text/javascript" src="JQuery.js"></script> <script type="text/javascript" src="Dialog/jquery.lightbox_me.js"></script> <?php function ShowLogin(){ $f_usr = $_POST["username"]; $f_pswd = $_POST["password"]; $con=mysql_connect("localhost","root",""); if(! $con){ die('Connection Failed'.mysql_error()); } mysql_select_db("projet",$con); $result = mysql_query("SELECT * FROM client WHERE username= '" .$f_usr. "' AND password= '" .$f_pswd. "' "); $numrows=mysql_num_rows($result); if ($numrows != 0){ header("Location: Homepage.php");} else{ ShowRegistration();} } ?> <script type="text/javascript"> function ShowRegistration(){ .get("Registration.php", function(data){ $("#descDialog").empty(); $("#descDialog").append(data); $("#descDialog").lightbox_me({ centered:true }); }) } </script> </head> <body> <form name="frm" action="Registration.php" method="post"> <center> <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="640" HEIGHT="480" id="RYNC" ALIGN=""> <PARAM NAME=movie VALUE="RYNC.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="../Flash/RYNC.swf" quality=high bgcolor=#FFFFFF WIDTH="640" HEIGHT="480" NAME="RYNC" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT> <br> Username <input type="text" value="" name="username"> <br> Password <input type="password" value="" name="password"> <br> </form> <input type="button" value="Log In" name="Login" onclick="<? ShowLogin(); ?>"> <input type="button" value="Register now" name="Register" onclick="ShowRegistration();"> <div id="descDialog"></div> </body> </html> Thanks in advance Regards, Chris
  25. Note: This is mainly a PHP issue, but the java part is a Bukkit plugin. My TCP Server (made in Java) is one that can send and recieve messages/commands from a client like PuTTy. Everything works perfectly in PuTTy, however when I use a small PHP client I made to test commands, it doesn't recieve the complete output. My PHP is as follows <?php echo '<html><body>'; include('config.php'); $service_port = $_GET['sPort']; $address = $_GET['sIP']; $command = null; $args = null; $api = 0; if (isset($_GET['api'])) { $api = 1; } if (!isset($_GET['sMsg'])) { die('No command given'); } else { $command = trim(strtolower($_GET['sMsg'])); if ($command == null || $command == "") { die('No command given'); } if ((strpos($command, ";")) == false) { /* Args check */ //do nothing, no args } else { $args = explode(";", $command); } } $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($socket === false) { die('Failed to create socket'); } $result = socket_connect($socket, $address, $service_port); if ($result === false) { die('Failed to connect to server'); } $messag = $command; $message = $messag."\n"; $out = ''; socket_write($socket, $message, strlen($message)); $resp = ""; while ($out = socket_read($socket, 2048)) { $resp .= $out; } $response = trim($resp); $rep = array("/", "\\", "-", "_", "(", ")", "'", "|", "Welcome! Please input the password.", ","); $stripped = str_replace($rep, "", $response); echo $stripped; socket_close($socket); echo '</body></html>'; ?> and when I send the command /adminsconnected the following Java code is fired by the server if (sent.equalsIgnoreCase("/adminsconnected")) { sendText("0", true); plugin.log.info("adminsConnected"); } public void sendText(String text, Boolean suppress) { try { if (suppress) { this.toClient.writeBytes(text + "\r\n"); } else { this.toClient.writeBytes(getTime() + " - "+text + "\r\n"); } if (!suppress) MainClass.log.info("[bTS] Sent: \"" + text + "\""); } catch (Exception e) { e.printStackTrace(); plugin.log.severe(e.toString() + " - sendText (suppress)"); } } My output from PHP is blank, however I recieve the "adminsConnected" and PuTTy gives "0" (the intended output) I get an error in my console: 18:25:53 [sEVERE] java.net.SocketException: Software caused connection abort: socket write error 18:25:53 [sEVERE] at java.net.SocketOutputStream.socketWrite0(Native Method) 18:25:53 [sEVERE] at java.net.SocketOutputStream.socketWrite(Unknown Source) 18:25:53 [sEVERE] at java.net.SocketOutputStream.write(Unknown Source) 18:25:53 [sEVERE] at java.io.DataOutputStream.writeBytes(Unknown Source) 18:25:53 [sEVERE] at com.atrociouss.BTS.Users.sendText(Users.java:339) 18:25:53 [sEVERE] at com.atrociouss.BTS.Users.ssendText(Users.java:323) 18:25:53 [sEVERE] at com.atrociouss.BTS.Users.run(Users.java:278) 18:25:53 [sEVERE] java.net.SocketException: Software caused connection abort: socket write error - sendText (suppress) I was wondering if this was a server issue, or a client issue and if its a mistake that I simply haven't been able to see because i've been staring at it for so long, or if theres something going terribly wrong with my code and I should start from scratch. Any help appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.