Jump to content

Recommended Posts

Hi again all,

 

Quick Dreamweaver problem:  I've got an add_inventory.php page that populates my database keyed off of 'id'.  When I built the record insertion form it asked for a destination, which I put in as show_inventory.php.  I built this page later on, to show certain fields the user just entered.

 

Added a recordset to the add page (rs_add_inventory), only choosing the 'id' field.  I need to pass that parameter to the show page, so it can display all the fields.  So going into the code, I saw Dreamweaver had written the following lines of code:

 

$insertGoTo = "show_inventory.php"

if (isset($_SERVER['QUERY_STRING'])) {

    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";

    $insertGoTo .= $_SERVER['QUERY_STRING'];

 

I modified the top line of code to read as follows, thinking it would pass the parameter:

 

$insertGoTo = "show_inventory.php?recordID=<?php echo $row_rs_add_inventory['id']; ?>";

 

Can anyone see what I did wrong?  I'm getting a Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

 

I'm kinda new at this, so any help would be appreciated.

Thanks in advance!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/70648-passing-record-id-problem-wdreamweaver/
Share on other sites

Ah, I should probably smack myself in the forehead for not trying concatenation. Thanks!  Someone else just pointed this out to me also.

 

However, it still doesn't pass the 'id' value. I think your syntax is 100% correct but unfortunately since this is the posting form, the 'id' value hasn't actually been defined yet (at the time) if that makes any sense. It's a self-incrementing element of the database, so I guess maybe it happens after the posting? I think I'm trying to do the database call before the element is populated... dunno.

 

Still confused.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.