Jump to content

parse error in php

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
hi people
this is very urgent
ive written a php script on ubuntu and it works fine on it
but when i try to put the files on windows apache server i get parse error
when i open the file i find it pretty missed up with alot of lines in the same line
please anyone help me!!
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Sounds like you're running afoul of the difference between how the two platforms save newline characters: x0A vs x0Ax0D. Try opening it in wordpad, jedit, or crimsoneditor.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
i did that shortly after the first post, i used a small application to convert it. now the file looks normal with lines and correct format..but i have the same error :parse error at the final linePosted via CodeCall Mobile

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
This question is impossible to answer. Either post the code, or the kind of parse error you are getting, or if you want the correct answer, post both.

unexpected T_STRING? unexpected T_VARIABLE? unexpected T_CONST? unexpected END? unexpected T_IF? The list of parse errors goes on...

#5
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You could use this:

sudo apt-get install tofrodos

then
unix2dos <phpfile>.php

You can also do "dos2unix". At work on our Redhat machines I have to convert all of my PHP code because of this.

#6
amrosama

amrosama

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 8,674 posts
tried that still doesnt work
but i used todos.exe from windows ill try this one from ubuntu and see what happens
thnx
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#7
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Odd error, if it works in one it should work in the other. Are they different PHP versions?

#8
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

Jordan said:

Odd error, if it works in one it should work in the other. Are they different PHP versions?

Not really, many functions need to be handled with special care under Windows. fopen(), stat(), mail() immediately come to mind. But I'm not going to guess what the problem could be, when the code and the line number which is causing the error could be posted.

#9
Guest_Jordan_*

Guest_Jordan_*
  • Guests
nonetheless, in regards to a syntax error, it should work on both the same.