[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 10-29-2006, 01:24 AM   #1 (permalink)
NamePros Regular
 
Join Date: Dec 2005
Posts: 208
5.00 NP$ (Donate)

JsteRmX is an unknown quantity at this point


Getting info to pre populate?

Hey, here is the website I am working on so that you can see what I am asking

http://domains.jesslester.com

What I want to happen, is when someone clicks on Make Offer, I want the corresponding domain name to automatically fill in where the person would enter the domain they are making an offer on. I want this to automatically populate. I know i could just create a different page for each domain, but I really rather not since I would have to make a new one for each domain.

Is this possible?

Thanks
__________________
+ Domains I have for sale here
JsteRmX is offline  
Old 10-29-2006, 02:37 AM   #2 (permalink)
Adrian
 
Hitch's Avatar
 
Join Date: Aug 2005
Location: Uk, South Yorkshire
Posts: 1,227
16.00 NP$ (Donate)

Hitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to beholdHitch is a splendid one to behold

Animal Rescue Third World Education Find Marrow Donors!
Ok, do something like this.

For your link, on the homepage, have
HTML Code:
/makeoffer.php?name=$domainvar
Remember, change $domainvar to your variable for the names.
Eg, $domains['name'], or whatever you use

Then, on makeoffer.php, add into your PHP page.
PHP Code:
$domain_name = $_GET['name'];
Then, in your form, on makeoffer.php, on the name textbox, set the value to $domain_name.

Replace:
HTML Code:
 <input name="domain" type="text" size="20" maxlength="255" /> 
with
HTML Code:
 <input name="domain" type="text" value="$domain_name" size="20" maxlength="255" /> 
Done. It should work

If you want some help, just PM me.

Adrian
__________________
NamePros

Last edited by Hitch; 10-29-2006 at 09:44 AM.
Hitch is offline  
Old 10-31-2006, 05:03 PM   #3 (permalink)
NamePros Regular
 
Join Date: Dec 2005
Posts: 208
5.00 NP$ (Donate)

JsteRmX is an unknown quantity at this point


hmm well this doesnt work. you can check the site again to see what happens now. I only tried this out on the first domain name in the list.

What I see in the text box now is $domain_name

I think the problem is that I never set the variables for all the domains. How would I go about doing this?
__________________
+ Domains I have for sale here
JsteRmX is offline  
Old 10-31-2006, 05:08 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
You need to replace $domainvar with the actual variable name of your "domain var" and use PHP to echo it into the URL. We can't know what the variable actually is without seeing your code.
Dan is offline  
Old 10-31-2006, 06:31 PM   #5 (permalink)
NamePros Regular
 
Join Date: Dec 2005
Posts: 208
5.00 NP$ (Donate)

JsteRmX is an unknown quantity at this point


well i dont have a variable for them, that i know of?

here is some of the code so you can see.

makeoffer.php (this is not complete code, just the important parts. It would be way to long to post the whole file)

PHP Code:
<?php
$domain_name
= $_GET['name'];
?>

<form id="form1" name="form1" method="post" action="makeoffercode.php">
        <label><span class="style21">Domain Name:
        <input name="domain" type="text" value="$domain_name" size="20" maxlength="255" />
          </span></label>
        <p class="style21">Offer Amount:
          <label>
          <input name="offer" type="text" value="$" size="10" maxlength="255" />
          </label>
        </p>
        <p align="left" class="style2 style1 style21">Your Email Address:
            <input name="emailfrom" type="text" size="20" maxlength="255" />
        </p>
        <p align="left" class="style2 style1 style21">Your Name:
            <input name="name" type="text" size="20" maxlength="255" />
        </p>
        <p align="left" class="style2 style1 style21">Other Message:</p>
        <p align="left" class="style2 style1 style21"><span class="style21">
          <label>
            <textarea name="message" cols="40" rows="4"></textarea>
            </label>
          </span></p>
        <p>
          <label>
          <input type="submit" name="Submit" value="Submit" />
          </label>
        </p>
        <p>&nbsp;</p>
      </form>
index.php (again, just the important parts)
PHP Code:
    <table width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC">
      <
tr bgcolor="#DBDBDB">
        <
td width="20%" height="24" bgcolor="#D6E6F8"><span class="style19">AgeiaPhysxCard.com</span></td>
        <
td width="20%" bgcolor="#D6E6F8"><div align="center" class="style19">07/24/07</div></td>
        <
td width="20%" bgcolor="#D6E6F8"><div align="center" class="style19"><a href="http://www.sedo.com/search/details.php4?domain=ageiaphysxcard.com&amp;tracked=&amp;partnerid=&amp;language=us" target="_blank">Make Offer at Sedo </a></div></td>
        <
td width="20%" bgcolor="#D6E6F8"><div align="center" class="style19"><a href="https://www.afternic.com/name.php?id=13777812">Make Offer at Afternic</a> </div></td>
        <
td width="20%" valign="middle" bgcolor="#D6E6F8"><form action="" method="post" name="offer1" class="style19" id="offer1">
          <
div align="center"><a href="http://domains.jesslester.com/makeoffer.php?name=$domainvar">Make Offer</a>          </div>
        </
form></td>
and that pretty much just repeats for every domain name listed in the table.

Please let me know if you need to see more.

Thanks for all the help.

I am sure this would have been much easier to make using MySQL. perhaps i should i consider redoing the whole thing.
__________________
+ Domains I have for sale here
JsteRmX is offline  
Old 10-31-2006, 07:31 PM   #6 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
 
Join Date: Feb 2006
Posts: 2,801
56.00 NP$ (Donate)

Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future

Autism Autism Autism Autism Autism Autism Autism
If you have each separate thing like that, you will have to change $domainvar to the domain yourself (for each one).
Dan is offline  
Old 11-01-2006, 07:43 PM   #7 (permalink)
NamePros Regular
 
Join Date: Dec 2005
Posts: 208
5.00 NP$ (Donate)

JsteRmX is an unknown quantity at this point


after trying many different things, i still am not able to get this to work.

In the link I changed the $domainvar to the actual Domain Name, but this didnt seem to work.

Not sure what is wrong

thanks for the help though.
__________________
+ Domains I have for sale here
JsteRmX is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 05:34 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85