This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Forms + php in nodes

Hello all,

(I previously posted this in the "how do I" forum but got no responses)

I'm using Drupal as an aplication framwork to become the new front
end to a database. It works really well for what I have wanted to do so far
but I'm having problems passing variables to the php scripts in the nodes.
eg: I have a bit of php in the body of a node (set to php):

$db = mssql_connect("xxxxxxxx","hubble","xxxxxxxx") or die("Unable to connect to server");
mssql_select_db("excell");
$cust_id = $_POST['cust_id'];
$result = mssql_query("select * from customers where id = $cust_id;");
$num_rows = mssql_num_rows($result);
while ($myrow = mssql_fetch_row($result)){
       $id = $myrow[0];
       $company = $myrow[3];
       $addr1 = $myrow[4];
       $addr2 = $myrow[5];
       $addr3 = $myrow[6];
       $city = $myrow[7];
       $postcode = $myrow[10];
       $tel = $myrow[11];
       $fax = $myrow[12];
       $notes = $myrow[13];
       print ("<p><b>Customer Id:</b> $id - <b>company name:</b> $company - <b>Tel:</b> $tel - Notes: $notes'</p><p>Address: $addr1,<br>$addr2,<br>$Addr3,<br>$city,<br>$postcode,</p><hr>");
   }

and linking to it thus:

http://www.excellhelpdesk.com/intranet//?q=node/39/cust_id=220

However cust_id remains empty. Whats the easiest way around this? How to I pass
the variables in? Im sure this is a no brainer to all the php +drupal experts :-)

Admin cannot receive email notification

Hi,

I am using drupal 4.6.2.

I set up notification and feedback modules.

When user contact admin by using Feedback form. The message is sent. But the admin is not notified by the email.

I took a look on the admin messaging account, on the recent posts, but I have nothing.

The admin notification settings look like this :

Teasers don't break properly when input type is PHP.

If I choose "PHP code" as my input format, I should be able to place an include after the break:

<p class="excerpt">This is the text that I want to use as my teaser.</p>

<--break-->

<?php include $_SERVER['DOCUMENT_ROOT'].'/'.conf_init().'/example.php' ?> 

The obvious intention here is for the include not to be displayed on summary pages. The problem is that the include gets rendered in its entirety on the summary pages.

widgEditor module

I read about widgEditor in this discussion and was intrigued.

So I created a module to make widgEditor / Drupal integration as easy as possible. Interested parties can download it here. It's quite simple - possibly rough around the edges. If there is much interest I will work to improve it.

hook_form onSubmit

Hopefully this one is quick...
How can I set an onSubmit event in the hook_form of a module?

thx

"User Related Content" module question

I've been looking for a module that can handle a tree of object relationships for an artist collaboration site, and this one seems close. What I need is a module that would allow users to specify a node as "using" other nodes and link back to them. Through this process each node would also display a list of links to other child nodes that "used" them.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions