HI,

I'm working with nodes (no path-auto). However, I'm trying to send a "get" and "post" information through the browser without success:

href="?q=node/12?id=[value]

I can read the good "Id" throug the status bar but the receiver page cannot read it. How should I to send this values working with nodes?

Thank you.

Comments

marcvangend’s picture

Can you explain what node 12 does, and what you need to do with the variable? Is node/12 a node with custom php?

afdiaz’s picture

Yes sorry!...

node/12 is a custom php created as "page":

I've a page node/11 in which several items are listed. Each item could be removed or modified by clicking in a button. That button send the ID of these item to node/12 to be processed (deleted or modified). Nevertheless, my scrip send the item information with a typical $GET in through the browser. Normally it is like "/page?=5, wher '5' is the id number (e.g.). In drupal I've a node structure like ?q=node/12 and I'm trying to send it through ?q=node/12?=5 without success.

marcvangend’s picture

I don't like to say "you're doing it all wrong", but I'm sorry... you're doing it all wrong. Allow me to explain.

Nodes can contain php, but you should avoid using php in nodes whenever possible. Nodes are meant to contain content, not functionality. A node is like an article in a newspaper; it contains a title, text and sometimes other data (like a picture).

If you need to add functionality to your site (for instance: displaying lists of nodes) you should install a module that does that. If the module you need does not exist, you can create your own module and put your custom php there.

For your needs, I advice you to take some time to learn about the Views module (http://drupal.org/project/views). Views is a module that can build lists (or tables) of nodes for you. You can choose yourself what you want to display for every node, so for instance you can build a table with 4 columns: title, author, date, delete link. All of this can be done without writing a single line of php.

Maybe you're thinking "who cares about modules, I can write my own code and I just want it to work". Some reasons to use existing modules are:
- The code has been reviewed by many users, so it is safer and better
- You will get more and better support from the community
- It will be easier to extend your site with new features in the future
- Modules often contain features you didn't even know you needed :-)
- Why write code yourself if someone already did it?

You can find modules here on drupal.org (http://drupal.org/project/modules) or for easier searching you can use www.drupalmodules.com.

Please don't hesitate to keep asking (well, search first of course). There is a lot to learn and the community is here to help.

afdiaz’s picture

Hey Marcvangend,

Thank you for your reply and your information (specially for the link to drupalmodules.com).

Well, maybe I've not explained well my problem and finally, after several tests and trials, I found the problem: double '@' symbols should be included in the link instead of '?' symbol:

Commonly, the usual link to send a information through the browser is

/page?[value]=[$_GET] (Eg: /mypage/?id=5, where 5 is the unique identification number in the database)

So, I've changed '?' for two '&&':

/page<b>&&</b>[value]=[$_GET] (Eg: /mypage/<b>&&</b>id=5, where 5 is the unique identification number in the database)

Now, it's running fine.

Thank you!

marcvangend’s picture

Alexander, I'm afraid you didn't really get my message. The link to drupalmodules.com is nice but it's not the most important thing I wrote. I'm happy for you that it seems to work, but I would not say that it's running fine. I'm afraid that if you proceed like this, you will end up with an insecure site (watch out for sql injections!) that does not take advantage of all the nice features that are built in to Drupal. Also, when something breaks, you will find that few people here is able and willing to support you.
Good luck with your site.