ID:268185
 
Hi

I have just started work on a DMCGI website and I am not sure how I would make a button link to another page I would make with DMCGI, what would be the easiest way to come about this?

Thanks
Mousie
Make the button a submit button for a form and put <FORM> tags around the button. The first form tag is where you put what ?href you want the button to go to.
<FORM method="GET" ACTION="?someotherpage">
In response to Jon88
To make the page would I do?

Page
testpage

In response to Mousie_kebabs
Mousie_kebabs wrote:
To make the page would I do?

Page
testpage
Page
NameOfPage //(doesn't really matter though.)
GetPage(href, href_list)
if(href=="whatever") // This is assuming that the link you clicked on was a link to ?whatever
content = "Hi!" // You can set variables like this dynamically in the proc, or even
// just as Page/NameOfPage/variable="something" at compile time.
return src // When you know this is the page to send to the user, return src.

However, if your form includes other information like stuff from an input box, you'll need to check if href starts with "whatever" or possibly check if href_list[1] is "whatever". I know the former will work and I think the latter will too.
In response to Jon88
I take it I need to make a GetPage proc. I do not have any clue where to start with that.
In response to Mousie_kebabs
Mousie_kebabs wrote:
I take it I need to make a GetPage proc. I do not have any clue where to start with that.

Sorry, since you were using a datum named "Page" I assumed you might be using this.
You'll have to create new pages using the method for however you chose to do DMCGI. For example: if you were using Dantom's htmllib, you would need to make a new /Form.

In response to Jon88
Would it be possible to link to another .dmb file? Like with HTML to make another page you link to the page name...
In response to Mousie_kebabs
Mousie_kebabs wrote:
Would it be possible to link to another .dmb file? Like with HTML to make another page you link to the page name...

Yes, but that's really inefficient. It's increadibly easy to put multiple pages inside a single DMCGI dmb. In Topic(), just check what the href is/starts with and send stuff to usr depending on that.