Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:16:39+00:00 2026-06-13T05:16:39+00:00

i have a java applet that calls this url that links to a php

  • 0

i have a java applet that calls this url that links to a php script that SHOULD write to file but…no dice. i get a http 500 error. Any clue?

http://127.0.0.1/DBoperations.php?operation=write&UserId=james&Score=10

#DBoperations.php
<?php
$operation = $_REQUEST["operation"]
$UserId = $_REQUEST["Userid"];
$Score = $_REQUEST["Score"];

if (operation =="write"){
write();
}
if (operation =="read"){
read();
}

function write()
{
$myFile = "testsroce.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "$UserId - $Score";
fwrite($fh, $stringData);
fclose($fh);
}

function read()
{
$file = new SplFileObject('testscores.txt');
$file->setFlags(SplFileObject::DROP_NEW_LINES);
$match = false;
foreach($file as $line){
if( false !== stripos( $line, $UserId ) ){
    $match = true;
    break;
}
}
if( true === $match ){
echo $file;
} else {
echo "No Match Found";
}
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:16:41+00:00Added an answer on June 13, 2026 at 5:16 am

    You are missing a semicolon after this line:

    $operation = $_REQUEST["operation"]
    

    Should be

    $operation = $_REQUEST["operation"];
    

    You are also missing a $ sign in a few places, e.g.

    if (operation =="write"){
    

    Should be:

    if ($operation =="write"){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java applet that runs fine locally on my desktop computer. but
I have a Java applet that is meant to run only on Windows. (It
I have an Java applet that loads native code through JNI. Everything worked just
I have a java applet that draws top left x,y(0,0) to bottom right x,y(500,500).
Good afternoon all, I have a Java applet that I wish to embed on
I'm have a Java app that also runs as an applet. The app also
I have a Java applet that is being included on a page in a
I have a website with a Java Applet and that applet needs to connect
I have a java applet. A class inside that applet is creating a thread
For a Facebook iframe app, we load a file browser Java applet. This works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.