Jump to content

[SOLVED] Passing text from one webpage into textarea of form


BradleyBrokers

Recommended Posts

A little help? I would like to make life a little easier for my website users.

 

When a user clicks the "More Information" tab (see www.BradleyBrokers.com/clients.php ),

I want the "Listing Code" to be automatically inserted into the form (see www.BradleyBrokers.com/missing.php ) so that a user does not have to remember the "Listing Code".

 

This is a snipit from the submit "More Information" webpage:


$Status[1]="<br><br><br>STATUS: Available<br> LISTING CODE: CousLincoln<br><span class='title'><a href=missing.html>MORE INFORMATION</a></span><img src='picts/arrow.gif' HEIGHT=15 WIDTH=15 alt='beer drinking'><br></div><div style='padding: 5px 0px 5px 15px; float:left; width:250px'></div>";

 

And, for example, I would like the LISTING CODE: CousLincoln to be inserted into the webform here:

 


<INPUT TYPE="TEXT" NAME="Listing Code" SIZE="30" CLASS="shadeform"> <B>Listing Code*</B><BR><BR>

 

I typically have 20-40 Listing Codes which change postion and get deleted with new ones added. Nothing static. I have put them into arrays for database use, but I cannot figure-out how to pass the info into the form. Any suggestions???

Link to comment
Share on other sites

you could add a get value to the url so for the first one the url would be

http://www.bradleybrokers.com/missing.php?code=Commissary

then add this to missing.php

<INPUT TYPE="TEXT" NAME="Listing Code" SIZE="30" CLASS="shadeform" value="<?=$_GET['code']?>"> <B>Listing Code*</B><BR><BR>

 

Scott.

Link to comment
Share on other sites

Hi Scott,

 

So I understand, for each $Status (listings on the first webpage which triggers the form) I would change each $Status to look like this:

 

$Status[1]="<br><br><br>STATUS: Available<br> LISTING CODE: CousLincoln<br><span class='title'>
<a href=missing.php?code=Commessary>MORE INFORMATION</a></span><img src='picts/arrow.gif' HEIGHT=15 WIDTH=15 alt='beer drinking'><br></div><div style='padding: 5px 0px 5px 15px; float:left; width:250px'></div>";

 

and then add this to missing.php:

 

<INPUT TYPE="TEXT" NAME="Listing Code" SIZE="30" CLASS="shadeform" value="<?=$_GET['code']?>"> <B>Listing Code*</B><BR><BR>

 

Do I have it correct? ???

Link to comment
Share on other sites

Scott (or anyone) it is not working. I get a Parse error with this script:

 

<INPUT TYPE="TEXT" NAME="Listing Code" SIZE="30" CLASS="shadeform" value="<?=$_GET['code']?>"> <B>Listing Code*</B><BR><BR>

 

www.BradleyBroekrs.com/clients.php to the form at www.bradleybrokers.com/missing.php

 

Any fixes?

Link to comment
Share on other sites

my guess is that short tags are not enabled on your server.  if that's the case, you'll have to put in the long version:

 

<?php echo $_GET['code']; ?>

 

as opposed to the shorthand version you're currently using:

 

<?=$_GET['code']?>

Link to comment
Share on other sites

There is code above and below this section:

 


</TD></TR><TR><TD>
Please enter only one "Listing Code"<br><br> 
</TD></TR><TR><TD>

<INPUT TYPE="TEXT" NAME="Listing Code" SIZE="30" CLASS="shadeform" value="<?PHP=$_GET['code']?>"> <B>Listing Code*</B><BR><BR>

</TD></TR><TR><TD>

 

The parse error is this:

 

Parse error: parse error in /home/www/bradleybrokers/missing.php on line 121

 

I gave <?PHP and <? both a try.

Link to comment
Share on other sites

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.