Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Support
  • Code University
  • [IF] Code Help
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
[IF] Code Help
Tweet Topic Started: Apr 13 2009, 03:36 AM (656 Views)
airchallenged Apr 13 2009, 03:36 AM Post #1


Posts:
9
Group:
Member
Member
#2,755
Joined:
Apr 6, 2009
Okay I'm new here and had a question so I thought I'd post it. So I am creating a form to post to a topic and have most of the code figured out. The only problem is it sends me to the general "create a new topic" page when I hit submit and then I have to hit the "start new topic" button again. I think my problem is with the code at the very beginning so I will post that. This is what I have:

Quote:
 

<form action='http://z8.invisionfree.com/Birth_of_the_Empire/index.php?showforum' method='post' name='REPLIER' onsubmit='return ValidateForm()' enctype='multipart/form-data'>
<input type='hidden' name='act' value='Post' />
<input type='hidden' name='s' value='' />
<input type='hidden' name='f' value='79' />
<input type='hidden' name='CODE' value='00' /><br />
<input type='hidden' name='st' value='0' />


So I have figured out what most of it means except for the 's' and 'st'. The 'f' is the forum number, 'CODE' is the post # in that specific thread and 'act' is what it is doing. I think the 'act' is wrong and by putting 'post it is bringing me to the post a thread screen. Any ideas on what would fix my problem?
Offline Profile Goto Top
 
Vitality Apr 13 2009, 08:21 AM Post #2
Member Avatar
Tabula Rasa

Posts:
784
Group:
Former Staff
Member
#320
Joined:
Jul 26, 2008
If you're trying to add a reply and not post a new topic, the CODE=02 and not 00.
Are we on the same page with your problem?
Offline Profile Goto Top
 
Reid Apr 13 2009, 08:24 AM Post #3
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
I'm not at home - if I was I would be able to help more - but I would suggest getting Firebug and pulling the values directly out of the new topic page.

That way, you get what they have when they post a new topic... although, it could be a little tricky to make the form post a topic in whatever forum you wanted. You could, I guess, pull the names from the links or something.

A lot of inherent issues with what you're trying to do, I think..
The Resource Board
Offline Profile Goto Top
 
airchallenged Apr 13 2009, 12:16 PM Post #4


Posts:
9
Group:
Member
Member
#2,755
Joined:
Apr 6, 2009
Vitality
Apr 13 2009, 08:21 AM
If you're trying to add a reply and not post a new topic, the CODE=02 and not 00.
Are we on the same page with your problem?
I am trying to add a new topic to a forum not just a new post. This is the only part of the code that could be a problem. The rest is just the general layout of the form with drop down choices and text boxes.

What is Firebug?
Offline Profile Goto Top
 
Kevin Apr 13 2009, 01:16 PM Post #5
Member Avatar


Posts:
700
Group:
Former Staff
Member
#8
Joined:
Jul 2, 2008
Coding language
HTML/CSS
Code:
 
<form action='http://z8.invisionfree.com/Birth_of_the_Empire/index.php?' method='post' name='REPLIER' onsubmit='return ValidateForm()' enctype='multipart/form-data'><input type='hidden' name='st' value='0' />
<input type='hidden' name='act' value='Post' />
<input type='hidden' name='s' value='' />
<input type='hidden' name='f' value='1' />
<input type='hidden' name='auth_key' value='c6b21d346e3556d24642b461f022d013' />
<input type='hidden' name='MAX_FILE_SIZE' value='51200000' />
<input type='hidden' name='CODE' value='01' /><br />


That's basically what it gives me on my test forum when I hit New Topic (I added in your URL). If you compare it to yours, there's no need for the st input, and the CODE value is 01, not 00. Also, you're missing the auth_key (which I don't know if you need or not), and that appears to be different on a user by user basis.

Maybe give this a try and see what it gives you:
Code:
 
<form action='http://z8.invisionfree.com/Birth_of_the_Empire/index.php?' method='post' name='REPLIER' onsubmit='return ValidateForm()' enctype='multipart/form-data'><input type='hidden' name='st' value='0' />
<input type='hidden' name='act' value='Post' />
<input type='hidden' name='s' value='' />
<input type='hidden' name='f' value='79' />
<input type='hidden' name='CODE' value='01' /><br />
Posted Image
Offline Profile Goto Top
 
Vitality Apr 13 2009, 03:16 PM Post #6
Member Avatar
Tabula Rasa

Posts:
784
Group:
Former Staff
Member
#320
Joined:
Jul 26, 2008
airchallenged
Apr 13 2009, 12:16 PM
What is Firebug?
Firebug is a very useful Firefox add-on. To quote them
Firefox's description
 
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
Offline Profile Goto Top
 
Reid Apr 13 2009, 03:53 PM Post #7
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Vitality
Apr 13 2009, 03:16 PM
airchallenged
Apr 13 2009, 12:16 PM
What is Firebug?
Firebug is a very useful Firefox add-on. To quote them
Firefox's description
 
Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
If you haven't tried it, seriously do so. It's probably one of the most useful tools I've ever found.

I can right click any element, hit "Inspect Element" and it automatically brings me to it...

For example, if I 'inspect element' the box I'm typing in right now, I get something like so...
http://aquate.us/u/firebug0.png

As you can see, it shows me the entire DOM layout and stuff. Also, it allows me to edit any of those values at will and change anything I want. I can also see all of the CSS affecting any element I want (which is how I fix lots of CSS problems, since I can edit those as well.) It basically lets you edit anything in the page in real time.

Also the console can be used to run scripts on the page. I can pull any script I've made out of its code, load a page on zbcode, plop it in the console, hit enter, and it runs it in real time as well.

You can define functions, variables, etc, without having to reload the page. You can also overwrite other functions or disable things or see how things work. You can also tell the console to 'Profile', then execute an action on a page, then end the profiler and it will tell you all of the functions that were called during the profile period. That lets you see exactly what the page is doing. You can then click on the function name and it switches over to the script tab and brings you right to the function in the script.

It's just a great, wonderful tool and I love it. :P

The image was stretching the page a lot, so I made it a link - Kevin
Edited by Kevin, Apr 13 2009, 04:57 PM.
The Resource Board
Offline Profile Goto Top
 
airchallenged Apr 13 2009, 04:22 PM Post #8


Posts:
9
Group:
Member
Member
#2,755
Joined:
Apr 6, 2009
Kevin
Apr 13 2009, 01:16 PM
Code:
 
<form action='http://z8.invisionfree.com/Birth_of_the_Empire/index.php?' method='post' name='REPLIER' onsubmit='return ValidateForm()' enctype='multipart/form-data'><input type='hidden' name='st' value='0' />
<input type='hidden' name='act' value='Post' />
<input type='hidden' name='s' value='' />
<input type='hidden' name='f' value='1' />
<input type='hidden' name='auth_key' value='c6b21d346e3556d24642b461f022d013' />
<input type='hidden' name='MAX_FILE_SIZE' value='51200000' />
<input type='hidden' name='CODE' value='01' /><br />


That's basically what it gives me on my test forum when I hit New Topic (I added in your URL). If you compare it to yours, there's no need for the st input, and the CODE value is 01, not 00. Also, you're missing the auth_key (which I don't know if you need or not), and that appears to be different on a user by user basis.

Maybe give this a try and see what it gives you:
Code:
 
<form action='http://z8.invisionfree.com/Birth_of_the_Empire/index.php?' method='post' name='REPLIER' onsubmit='return ValidateForm()' enctype='multipart/form-data'><input type='hidden' name='st' value='0' />
<input type='hidden' name='act' value='Post' />
<input type='hidden' name='s' value='' />
<input type='hidden' name='f' value='79' />
<input type='hidden' name='CODE' value='01' /><br />
I get:

Quote:
 
The error returned was:

Authorization mismatch - please go back and try again. If you have been trying to access a function incorrectly, please use the proper method.


Not quite sure what that means... probably the lack of Authourization key maybe. although the topic is open to all members and admin to post in.

Now to figure out how to use Firebug.
Offline Profile Goto Top
 
Kevin Apr 13 2009, 04:56 PM Post #9
Member Avatar


Posts:
700
Group:
Former Staff
Member
#8
Joined:
Jul 2, 2008
Coding language
HTML/CSS
It's definitely due to the lack of authorization code (I tested it for myself). I'm a little confused though, is this for a brand new topic or a post within an existing topic? It seems as though you've said it's for both (in different posts)...

When the user posts with this form, is the post to go under their username? Or is it something that guests can access and post with? Could you provide a little more information about what exactly you want the code to achieve, that will make it easier to understand how it should be done...
Posted Image
Offline Profile Goto Top
 
airchallenged Apr 13 2009, 05:04 PM Post #10


Posts:
9
Group:
Member
Member
#2,755
Joined:
Apr 6, 2009
Sure sorry if I made it sound confusing. When they hit submit it will start a brand new topic from scratch in the specific section. It is for a game turn for a nation sim. I hoped it would go under their user name so I could know who posted each thread when I viewed them to process what ever action they wanted done in the body. In the Form they are unwittingly filling out the topic title, description, and text.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code University · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2
  • 3

Track Topic · E-mail Topic Time: 7:48 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy