Current location: Hot Scripts Forums » Programming Languages » PHP » Help with the php Post.


Help with the php Post.

Reply
  #1 (permalink)  
Old 12-26-08, 10:21 AM
zippoxer zippoxer is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Help with the php Post.

I want to go into a specific page, but to get there by an address.
i got the next code (ive made it short).
Code:
<form name="form1" method="post" action="?id=33&act=do"> 
<input name="action" type="radio" value="STTAI">
<input type="submit" name="Submit" value="Submit"><input type="hidden" name="battle_id" value="33449314">
and the full version: (just tha post method..)
Code:
<div align="center">     <form name="form1" method="post" action="?id=33&act=do">       <table width="95%" border="0" cellspacing="0" class="table" cellpadding="0">            <tr>              <td colspan="2" align="center" style="border-top:none;" class="subHeader"> Battle options:</td>              </tr>            <tr>              <td align="right" style="padding-right:5px;"><input name="action" type="radio" value="STTAI"></td>              <td align="left" style="padding-left:5px;">Fist</td>            </tr>            <tr>              <td align="right" style="padding-right:5px;"><input name="action" type="radio" value="STCHA"></td>              <td align="left" style="padding-left:5px;">Chakra attack </td>            </tr>            <tr>              <td align="right" style="padding-right:5px;"><input name="action" type="radio" value="FLEE"></td>              <td align="left" style="padding-left:5px;">Flee</td>            </tr><tr>         <td colspan="2" align="center" style="font-weight:bold">Items &amp; weapons: </td></tr><tr>          <td align="right" style="padding-right:5px;"><input name="action" type="radio" value="WPN:16"></td>          <td align="left" style="padding-left:5px;">Enchanted Sai</td>          </tr><tr>          <td align="right" style="padding-right:5px;"><input name="action" type="radio" value="ITM:85"></td>          <td align="left" style="padding-left:5px;">Senbon</td>          </tr><tr>              <td colspan="2" align="center" style="font-weight:bold;">Jutsu:</td>              </tr><tr>               <td width="48%" align="right" style="padding-right:5px;"><input name="action" type="radio" value="JUT:1"></td>               <td width="52%" align="left" style="padding-left:5px;">Clone Technique</td>             </tr><tr>               <td width="48%" align="right" style="padding-right:5px;"><input name="action" type="radio" value="JUT:3"></td>               <td width="52%" align="left" style="padding-left:5px;">Replacement Technique</td>             </tr><tr>               <td width="48%" align="right" style="padding-right:5px;"><input name="action" type="radio" value="JUT:31"></td>               <td width="52%" align="left" style="padding-left:5px;">Senbon Strike</td>             </tr><tr>               <td width="48%" align="right" style="padding-right:5px;"><input name="action" type="radio" value="JUT:2"></td>               <td width="52%" align="left" style="padding-left:5px;">Transform Technique</td>             </tr><tr><td colspan="2" style="padding:10px;" align="center"><input type="submit" name="Submit" value="Submit"><input type="hidden" name="battle_id" value="33449314"></td>            </tr></table></form><br /><br /></div></td>
now i want that without clicking submit and all i will just make the submit action by typing a web Address.
i've tried this address:
http://website-domain.com/?id=33&act...le_id=33449314
so its supposed to make the same action that submit makes but it doesnt xD
for who that wants to know i used the Values and the names in the post form, and made from it an address.

Last edited by zippoxer; 12-26-08 at 10:27 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-26-08, 10:51 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
I'm confussed about what you actually want. Can you explain a bit more and format the code so that it's easier to see and where is the PHP code that handles this?

Kind regards
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-26-08, 11:02 AM
zippoxer zippoxer is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
the php base code its on another website xD
but i will give you another example.
please goto: http://theninja-rpg.com/ (not for playing in it )
and login to
Username: demouser3
Password: 1234567890
srry i just dont got anyother example.. :\ but its a browser php based game.
after you logged in, then goto the button "Academy", Choose for example Weapon Class, and click submit.
you can see that up in the address its changed from: http://theninja-rpg.com/?id=18, to: http://theninja-rpg.com/?id=18&page=train
and if you go back and choose another option like the last one, "Study".
you will be directed to the same address. (http://theninja-rpg.com/?id=18&page=train)
now I just want to know howto get directly into that page of weapon training, by typing an address.
like:
http://theninja-rpg.com/?id=18&page=train&train=weap
the &train=weap i know because i saw the form by viewing the source of the page, the value of the choosing form is "Train" and the name of the weapon training is "weap".
but something is not correct, maybe i need to add a Submit or something to the address?
couse the address i've tried isnt leading me to the page i want.
**** I Wrote too much .. :\ hope you can understand me...

Good Luck xD

Last edited by zippoxer; 12-26-08 at 11:09 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 12-26-08, 11:29 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
The problem you have is that a website is still protected by the login script so jumping around a website like this would be impossible however if this just help with a query string "?param=value" then this all comes from the php $_Get request which can be accessed like the following;

PHP Code:


echo $_GET['param']; //would echo the value of the param
//each param name is accessible via the corrisponding $_GET['whatever']; 
Its not really a different page that shows, it uses the request from the query string to build a dynamic page.

for instance;

PHP Code:


if($_GET['page'] == 1) echo "You are on Page 1";
else if(
$_GET['page'] == 2) echo "You are on Page 2";
else echo 
"You are on page {$_GET[page]}, which I havnt provided an example for"
shove that into a php page you have and type the query string on the end as "?page=1" (without quotes) and then change the page number to see if different outputs.

You would more than likely use a submit to bounce the user to the next url using a header redirect or a form action redirect but building these queries I don't think are possible on the fly (ie accessing the address bar of the browser as the user interacts with the page) I could be wrong but I've never seen it. I think it would be protected since it could be an exploited feature (adverts and dummy sites etc).

Cheers
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 12-26-08, 11:46 AM
zippoxer zippoxer is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
so i just have to guess the variables :\
lets say if the variable was "page" like u said on your first code.
so i need to use this address?
http://website-domain.com/?page=1
1 or whatever, but the problem is that the addres here is:
http://website-domain.com/?id=1
id its the page and from that you can continue the code:
http://website-domain.com/?id=1&page=1
all the thing here its to guess :\ but if i wa got the php base code, i think it was muchh easier xD
but i will work on the code you gave me and try to get the correct variables.
thanks xD
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 12-26-08, 11:54 AM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
yeah sure you can have as many get requests as you like (there is a limit on the string length in the address bar but its unlikely that you would use the entireirty of the space)

?page=1&section=A&MyFavouriteColour=Green

if you wanted - it all depends on how its put together however please bare in mind that this could all probably be handled better with just a form submit and using $_POST variables. Query strings are somewhat of a pain as the user can modify them; consider the followign


payment.php?basketvalue=4000

By changing the value of the basket you dont need to pay as much you will never see this by the way.

Do all of your testing through a form and validate user input. It makes it harder to validate the $_GET request and is really only used where it wouldnt matter if the user mods the url (ie search pages)

Kind regards
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 12-26-08, 02:19 PM
zippoxer zippoxer is offline
Newbie Coder
 
Join Date: Dec 2008
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
tyy man i will use that now xDD first of all i will find another newbie website to test on it
yeah and about the payment, i will never see this xD
maybe when the php language was just new and all, someone used it but not for shops xDD

Last edited by zippoxer; 12-26-08 at 02:22 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 03:22 AM
Php Mysql Bug??? tranquilraven PHP 4 03-01-06 04:06 AM
how to solve this PHP error? j14nhAo PHP 1 02-16-06 08:48 AM
Trying to recode my php script into c to run on linux... DaJackal C/C++ 1 02-03-06 09:22 PM
Mouseover with Single PHP page rjwebgraphix PHP 7 09-16-04 06:15 PM


All times are GMT -5. The time now is 11:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.