Jump to content

mariam

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mariam's Achievements

Member

Member (2/5)

0

Reputation

  1. hi, in order for my website to display a php/html page it should be in the /public_html folder , same goes for all the text files etc .(i am using 000webhost.com). now ive developed an android java application that does ftp upload . i.e sends a text file from java to my web server. the problem is that it uploads to /root directory and not in its sub folder /root/public_html where i need it to be...although im commanding it to go in sub directory and not in root ....any one knows how to make my text file move from /root to /root/public_html using a php code???? any help would be appreciated
  2. Thanks for the reply. i checked the link it says "JFileUpload - Upload files and folders with a java applet." However the file im trying to upload is just a text file (being sent from a java application). Its not a java applet.
  3. Hi, i would like to know if it is possible for me to upload say a text file on the web server of my webhost (000webhost.com) directly from my website. As in the website would have an upload button which would upload the file directly on the webserver (instead of me going to 000webhost.com >> members area>> control panel>>filemanager>>upload etc etc). Actually i want this java application me and my college friends are developing to send a text file to the web server that would be plotted by this applet. I somehow need to get the text file from java (mobile phone) to the webserver. On client end (mobile3/java) we have used httppost that asks for a url to send the file to. We have that part ready but we dont know what url to give to get the the text file on the server. Does anybody has any idea regarding this? ps: i am not sure where to post this so i've posted it in 2 forums
  4. Hi, i would like to know if it is possible for me to upload say a text file on the web server of my webhost (000webhost.com) directly from my website. As in the website would have an upload button which would upload the file directly on the webserver (instead of me going to 000webhost.com >> members area>> control panel>>filemanager>>upload etc etc). Actually i want this java application me and my college friends are developing to send a text file to the web server that would be plotted by this applet. I somehow need to get the text file from java (mobile phone) to the webserver. On client end (mobile3/java) we have used httppost that asks for a url to send the file to. We have that part ready but we dont know what url to give to get the the text file on the server. Does anybody has any idea regarding this?
  5. hi, i want this java application to send a text file to my url. A java side script ive found is ' public class Web_Post extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Toast.makeText(this, "Just below setcontentview", Toast.LENGTH_LONG).show(); final byte[] buffer = new byte[1024]; File file = new File("./sdcard/Android/randomtext.txt"); try { HttpClient client = new DefaultHttpClient(); String postURL = "http://www.example.com/index.php?foo="+ buffer[1] +"bar&bla=blub"; postURL.concat(postURL + ";" + buffer[2]); HttpPost post = new HttpPost(postURL); Toast.makeText(this, "Inisde 'try' statement", Toast.LENGTH_LONG).show(); FileBody bin = new FileBody(file); MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); reqEntity.addPart("myFile", bin); post.setEntity(reqEntity); HttpResponse response = client.execute(post); HttpEntity resEntity = response.getEntity(); Toast.makeText(this, "Response and request made", Toast.LENGTH_LONG).show(); if (resEntity != null) { Log.i("RESPONSE",EntityUtils.toString(resEntity)); Toast.makeText(this, "Inside the if statement", Toast.LENGTH_LONG).show(); Toast.makeText(this, EntityUtils.toString(resEntity), Toast.LENGTH_LONG).show(); } } catch (Exception e) { e.printStackTrace(); } } } [/Code] I am looking for a php script on how to receive the text file at my website. please help
  6. Hi, I am new to netbeans. I am trying to follow a youtube tutorial "Part 2: Creating MySQL Database User" for creating a database in netbeans. However i can't get my MySQL server at localhost:3306 to connect. I think its probably because i dont know its admin properties. the admin properties it requires are 1)path/URL to admin tool 2)path to start command 3)path to stop command i am using xampp so paths are to be given according to it.the paths ive provided are 1)C:\xampp\xampp-control.exe 2)C:\xampp\mysql\bin\mysqld.exe 3)C:\xampp\mysql\bin\mysqladmin.exe while no 2 and 3 are the correct paths as most of the googling i did regarding this lead to these two paths time and again how ever im not sure if path 1 i've given is correct or not. Does anyone has any idea whats the path to admin tools in xampp
  7. i hav etried re-loading the files... now it only displays the background image fr the graph but no plotting
  8. it opens the page www.domain.com
  9. the ? and & when encorprated does not plot the graph but display an outline of 400 x 500..
  10. i am using "jpowered garphs" to plot graph using values from database... the following script (taken from site) is used calling the required files... but the syntax used s not familiar to us.. <img src="http://www.domain.com/jpowered/graph/line-graph.php? data=[urltoDATASOURCE]& config=[urltoCONFIG]" width="500" height="400" /> this does not display the graph what do the ? and & (in red) indicate?? i have interpreted this script as <img src="http://www.icyourheart.webuda.com/jpowered/graph/line-graph.php" dbinfo="public_html/graphtest/dbinfo.php" config="http://icyourheart.webuda.com/graphtest/config.htm" width=500 height=400 /> it displays the img of "http://www.icyourheart.webuda.com/jpowered/graph/line-graph.php" but next lines are not called (i.e dbinfo="public_html/graphtest/dbinfo.php" and config="http://icyourheart.webuda.com/graphtest/config.htm" plz help
  11. i am trying to develope a code that reads data from the specific tcp port (5556 in our case)... we are using socket programming... the code reads the data and saves it in a variable. we want that the socket remains open all the time as continuous data is being received.. also i dont exactly know where to embed this code in our web..should an html page contain this code? eg the code og our website home page? please guide... <? // set some variables $host = "192.168.1.99"; $port = 1234; // don't timeout! set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); // bind socket to port $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n"); // start listening for connections $result = socket_listen($socket, 3) or die("Could not set up socket listener\n"); // accept incoming connections // spawn another socket to handle communication $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); // read client input $input = socket_read($spawn, 1024) or die("Could not read input\n"); // clean up input string $input = trim($input); // reverse client input and send back $output = strrev($input) . "\n"; socket_write($spawn, $output, strlen ($output)) or die("Could not write output\n"); // close sockets socket_close($spawn); socket_close($socket); ?> i need to write the data received in the database too
  12. yes it worked like that. thanx!
  13. i wrote a for loging in a specific page.... logiing in just requires the username attribute.. no password is required. it works fine on local host using xamp but when i host the website it gives the following error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a3907930_root'@'10.1.1.42' (using password: NO) in /home/a3907930/public_html/doc_checklogin.php on line 15 following is the code: <?php $host = "mysql14.000webhost.com"; $db_name = "a3907930_mehreen"; $username = "a3907930_root"; $password = "aaaAAA111"; $tbl_name="members"; //$host="localhost"; // Host name //$username="root"; // Mysql username //$password=""; // Mysql password //$db_name="mehreen"; // Database name //$tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect($host, $username)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); // username sent from form $myusername=$_POST['myusername']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, and redirect to profile file session_register("myusername"); } //addition: if ($myusername=='mariam') { header ("location:mariam_profile.php"); } elseif ($myusername=='mehreen') { header ("location:mehreen_profile.php"); } ?>
  14. its working now with "==' insted of '=" in if statment thanx!
  15. i have written a code for checking username and password, and then directing to a specific profile page w.r.t the username entered.. the password checking works fine but it directs the page to only one profile irrespective of the username entered.. below is my code <?php //$mysql_host = "mysql14.000webhost.com"; //$mysql_database = "a3907930_mehreen"; //$mysql_user = "a3907930_root"; //$mysql_password = "aaaAAA111"; $host="mysql14.000webhost.com"; // Host name $username="a3907930_root"; // Mysql username $password="aaaAAA111"; // Mysql password $db_name="a3907930_mehreen"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); if ($myusername='mehreen') header ("location:mehreen_profile.php"); elseif ($myusername='mariam') header ("location:mariam_profile.php"); else header ("location:login_page.html"); } else { header("location:invalidpassword.html"); } ?> could u plz help!
×
×
  • 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.