Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-04-2008, 08:23 PM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 541
Last Blog:
ubuntu... do not upgra...
Rep Power: 5
phpforfun will become famous soon enough
Default Getting PHP to execute from a form

Hey, ok so I kinda have an issue, not too hard to explain, here is the code to a page I have:
PHP Code:
<? if(isset($_GET['code'])){ Echo "code: $code"; } ?>
and when I set $_GET['code'] to be "<? echo "test"; ?>" it wont show anything, but when I view the source, I see "<? echo "test"; ?>"

What can I insert in the field or URL to make it so it will actually echo "test" ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 05-04-2008, 10:40 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,364
Last Blog:
PHPUnit
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default Re: Getting PHP to execute from a form

?code=test
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-05-2008, 12:59 AM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 541
Last Blog:
ubuntu... do not upgra...
Rep Power: 5
phpforfun will become famous soon enough
Default Re: Getting PHP to execute from a form

Nooo sir, I dont mean I have a problem giving the variable a value, I have a problem getting the PHP to execute, see attachment

It just goes into the source as if its html.
Attached Thumbnails
To view attachments your post count must be 1 or greater. Your post count is 0 momentarily.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-05-2008, 07:24 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 25
Posts: 4,565
Last Blog:
PHP: list()
Rep Power: 50
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: Getting PHP to execute from a form

You are passing ?code=<? echo "test"; ?> ? Why not pass the value "test" and then echo $code?

If you are really intent on passing PHP code via the URL (which is not recommended) use the eval function. PHP: eval - Manual

Also, you should include <?php on your beginning tag.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-05-2008, 11:49 PM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 541
Last Blog:
ubuntu... do not upgra...
Rep Power: 5
phpforfun will become famous soon enough
Default Re: Getting PHP to execute from a form

Doesnt work, not sure you get it :P but ok.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 05-06-2008, 12:27 AM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,364
Last Blog:
PHPUnit
Rep Power: 50
John is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of lightJohn is a glorious beacon of light
Send a message via AIM to John
Default Re: Getting PHP to execute from a form

I'm interested to know why you want to create a php shell?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-06-2008, 12:41 AM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 541
Last Blog:
ubuntu... do not upgra...
Rep Power: 5
phpforfun will become famous soon enough
Default Re: Getting PHP to execute from a form

Quote:
Originally Posted by John View Post
I'm interested to know why you want to create a php shell?
pm'd
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-06-2008, 06:40 AM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 25
Posts: 4,565
Last Blog:
PHP: list()
Rep Power: 50
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: Getting PHP to execute from a form

Maybe I don't understand what you want. You are trying to pass PHP via the URL and execute it, correct?
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-06-2008, 01:54 PM
phpforfun's Avatar   
phpforfun phpforfun is offline
Programming God
 
Join Date: Feb 2008
Posts: 541
Last Blog:
ubuntu... do not upgra...
Rep Power: 5
phpforfun will become famous soon enough
Default Re: Getting PHP to execute from a form

Yes, it seems as if its not possible now, but back when I coded a few years ago, it was possible
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginners Guide To PHP: *Tutorial* renlok PHP Tutorials 3 04-22-2008 03:20 PM
PHP 5 and OOP Jordan PHP Tutorials 0 04-04-2008 05:06 PM


All times are GMT -5. The time now is 01:22 AM.

Contest Stats

dargueta ........ 93.00000
John ........ 87.50000
Xav ........ 70.00000
MeTh0Dz ........ 20.00000
gaylo565 ........ 18.00000
Johnnyboy ........ 3.00000

Contest Rules

Ads