Jump to content

Jpoel

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Jpoel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Cheers! Strange why that wouldnt work I wanted the code to stop executing there, so i changed die($MonthNumber); to echo $MonthNumber; die(); And it worked fine Thanks again
  2. Its simple enough, but when i run the php script it returns null ??? Anyone got any idea whats up? $Month = "Aug"; $Months = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); $MonthNumber = array_search($Month,$Months); die($MonthNumber); Thanks :/
  3. Use something like this? <?php $useragent = $_SERVER['HTTP_USER_AGENT']; if(!preg_match('|Firefox/([0-9\.]+)|',$useragent,$matched)) { die("You must use firefox to view this page"); } //Anything from now on will only be seen by firefox users. ?> Edit: Sorry, didnt see your post BadBad
  4. I was only going to write to the file because i knew i could use the include function to run the php But your way works fine (Y) Cheers.
  5. Hey, thanks allot man it works now!
  6. I get this when i copy and paste that code you have just given into a php script and run it. Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampplite\htdocs\Pickle\runit.php(2) : eval()'d code on line 1 Warning: Unexpected character in input: ''' (ASCII=39) state=1 in C:\xampplite\htdocs\Pickle\runit.php(2) : eval()'d code on line 1 Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampplite\htdocs\Pickle\runit.php(2) : eval()'d code on line 1
  7. Im sure it is. but im the only one to be using this script. Plus im going to be running it on my Xampplite server too, not anything public
  8. Ok basically. this is what i have. I want the user to be able to enter PHP code in the box, click the button, and have it executed. Ive thought of one solution, Which is to save what the user types to a text file held on my server, and then use the include function to run the php code.. and this is what i came up with: $script = $_POST['script']; if($script){ $myFile = "ScriptHook.hk"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $script); fclose($fh); include 'ScriptHook.hk'; } But i get loads of errors like this: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampplite\htdocs\Pickle\ScriptHook.hk on line 2 Parse error: syntax error, unexpected $end in C:\xampplite\htdocs\Pickle\ScriptHook.hk on line 17 Thats because when my scripts writes to ScriptHook.hk.. it changes all the " to \", rendering the script unexecutable. Anyone know how i could do this? Cheers.
  9. Heres what i want to do: In my Visual Basic form i send data to a PHP script through a hidden web-browser, A user of my program has a User ID, i want to encrypt this UserID using Visual basic, into some sort of code, I then want to pass this User ID and the encrypted User ID to PHP, PHP then decrypts the Encrypted User ID, and compares it to the normal User ID, and if they match, the php script that i am going to write executes if they do not match, a message like: "Invalid session." appears, and the script is not executed i want to do this, as i want maximum security when submitting PHP scripts using VB, as i am aware people can decompile my visual basic code, find the link to the php file, and much around with it. Thanks.
  10. Hi again Heres the deal. I have a text file, which is constantly having things written to it example: the text file is in the form of: ,James:1: ,Kimberley:2: ,Bob:3: ,Joe:4: ,John:5: every now and again, a new value is inserted into the end of the text file, example, Josh is added: ,James:1: ,Kimberley:2: ,Bob:3: ,Joe:4: ,John:5: ,Josh:6: However, when this php script is used to add a new value to the end of the text file, and the length of the file is 30 lines long in length, what i want is for the php script to remove the first line, and add the new value to the end, to maintain the 30 line limit Does anyone know how i could do this? Thanks. PS I use Fwrite and Fread to write to the text file.
  11. the userID is generated by the visual basic program, so i could send it as a variable to the php script
  12. I'm not really looking to "varify" the users, this is only for a small college computing project
  13. hi guys i want to make an online now system for my visual basic program, one which shows who is using the program at the same time as others each user is asigned a UserID by visual basic, and i want to use a php script to somehow log this UserID into a text file and remove it once the program is closed. For example: User123 logs in, followed by User152 Each of the user's clients will automatically use PHP to update a text file held on my server in the form of something like this: &Usersonline=,User123,User152, User 123 then logs off, and the text file is altered again: &Usersonline=,User152, And i can then use Visual basic to parse this text file into a list box (thats the easy part ) Does anyone know how i could do this? Im not very familiar with MySQL so if any responses suggest that, please tell me the SQL Syntax, code to create tables, etc And please note, im not asking you to help me with the Visual Basic code, just the PHP/SQL
×
×
  • 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.