Get of Post value

Status
Niet open voor verdere reacties.

comass

Gebruiker
Lid geworden
19 dec 2000
Berichten
456
Hoi,

Ik probeer een waarde uit het ene formulier te gebruiken in het andere formulier.

Het script komt hier vandaan
http://www.cj-design.com/demos/cjdomainwhoisv1/index.php

In dit script staat o.a. deze opdracht regel bij de config.php
PHP:
http://www.site.com/order.php?domain=%domain%%tld%"

Nu wil deze waarde terug hebben in een bestelformulier.

Iemand een idee?
 
bedoel je dat de waarde getoond moet worden in een text veld?:
PHP:
echo "<input type='text' value='".$_GET['domain']."' name='domain'>";
 
Jip de tekst moet in een text veld zodat ik deze weer kan mailen met het bestelformulier.
Behalve de domein naam ook de extentie.

domain=%domain%%tld%
 
De extensie is toch al deel van de domeinnaam? Of wil je het naam gedeelte en de TLD apart?
 
Laatst bewerkt:
Je kunt het nog zo proberen, ik gebruik de quotes altijd andersom:

PHP:
echo '<input type="text" value="' . $_GET[ 'domain' ] . '" name="domain">';

Maar dat zou niet uit mogen maken.

Kun je je hele code even posten?
 
config.php
PHP:
<?
/*
	CJ Domain Whois V1.0
	
	CONFIGURATION FILE
	
*/

# URL to your WHOIS script
$whoisUrl = "http://www.domein.com";

# URL to send users to when the click the register button
# %domain% and %tld% are substituted with the searched-for domain and extension.
# example: $registerURL = "http://www.site.com/order.php?domain=%domain%%tld%";
$registerUrl = "http://www.domein.com/index.php?aid=102&page=order&domain=%domain%&tld=%tld%";

# Whether or not to show the "Register" button on the results page.  When click, the button will submit to the above URL
$showRegisterButton = true;

# Whether or not to show the price column in the results table.
$showPriceColumn = true;

# Width of the Whois popUp window
$whoisWindowWidth = 600;

# Height of the Whois popUp window
$whoisWindowHeight = 400;

# Progress image to show - see "images" folder for available animations (or add your own!)
$progressImage = "progressbar1.gif";

# Hide progress image by setting below variable to false
$showProgressImage = true;

# To show progress percent (instead of progress image), set below variable to true
$showProgressPercent = false;

# The maximum number of searches to allow per session - this is to combat misuse
$maximumSearches = 250;

# see "languages" folder for available languages
$language = "english";

# see "css" folder for available stylesheets - or create your own using an existing stylesheet as a guide!
$stylesheet = "styles3.css";

# If you get errors about exec() not working or "Warning: exec() has been disabled for security reasons",
# try changing the following variable to true
$useSocket = false;

#
# Read Carefully...
# ------------------
# Below is a list of Whois servers.  The Whois will look up in this order (and will also print
# in this order). Therefore, you can change the order here.  

# You can also add/delete domains to be looked up by the CJ Whois by commenting out the array item 
# (the first item is commented out to demonstrate this).  When adding (or editing) whois details below,
# remember to include the "nomatch" attribute which is what the whois server returns when the domain 
# IS available.  For more help on this, please consult the forum: www.cj-design.com/forum.

# You can also edit the price of each domain here.  The currency symbol can be found in the language
# files.  "English" currency sign is set as £ (pound) by default, you can change this to $ (dollar) by
# editing "/languages/english.php"
# 

$domainInfo = array(
		/*
		"xxx" => array(
				"server"=>"whois.example.commented.out"
				"nomatch"=>"no match",
				"price"=>10.99,
			),
		*/
		"com" => array(
				"server"=>"whois.crsnic.net",
				"nomatch"=>"no match",
				"price"=>12.99,
			),
		"co.uk" => array(
				"server"=>"whois.nic.uk",
				"nomatch"=>"no match",
				"price"=>4.95,
			),			
		"net" => array(
				"server"=>"whois.crsnic.net",
				"nomatch"=>"no match",
				"price"=>12.99,
			),
		"org" => array(
				"server"=>"whois.pir.org",
				"nomatch"=>"not found",
				"price"=>12.99,
			),
		"info" => array(
				"server"=>"whois.afilias.net",
				"nomatch"=>"not found",
				"price"=>12.99,
			),
		"biz" => array(
				"server"=>"whois.nic.biz",
				"nomatch"=>"not found",
				"price"=>12.99,
			),
		"eu" => array(
				"server"=>"whois.eu",
				"nomatch"=>"FREE",
				"price"=>19.99,
			),
        "nl" => array(
				"server"=> "whois.domain-registry.nl",
				"nomatch"=> "active",
				"price"=>12.99,
			),
	);

//------------// !! DO NOT edit below this line !!! //------------//

$_SESSION['preventspam'] = md5($whoisUrl);
include("languages/".(($language) ? $language : "english").".php");
include("functions.php");
?>

whois.php
PHP:
<?
if($_GET['action'] == "view")
{
	session_start();
	include("config.php");
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Whois Details</title>
<?
if($language == "arabic")
{
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<meta http-equiv="Content-Language" content="ar-sa" />
<?
}
else
{
?>
<?
}
?>
<link rel="stylesheet" type="text/css" media="screen, projection" href="<? print $whoisUrl; ?>/css/<? print $stylesheet; ?>">
</head>
<body>
<?	
}
	$results = array();
	
	if($_GET['action'] == "view")
	{
		print "<h1>".getLabel("whois_details_title")."</h1>";
		
		if($_SESSION && ($_SESSION['preventspam'] == md5($whoisUrl)))
		{		
			$tldOK = checkTLD($_POST['tld']);
			
			if($GLOBAL_DOMAIN && $tldOK)
			{
				if($fetch = getWhoisRecords($_POST['tld'], $GLOBAL_DOMAIN))
					$record = $fetch;
				else
					$record = "no";	
			}
			
			if($record)
			{
				print "<h2>".getLabel("whois_records_below", $GLOBAL_DOMAIN, $_POST['tld'])."</h2>";
				print "<pre id=\"whoisdetails\">\n";
				if($record == "no")
					print getLabel("no_whois_record", $GLOBAL_DOMAIN, $_POST['tld']);
				else if($record == "adown")
					print getLabel("whois_server_down", $GLOBAL_DOMAIN, $_POST['tld']);
				else
					print trim($fetch);
				print "</pre>";
			}
		}
		print "<br />";
		print "<div style='text-align:center'>";
		print "<input type='button' value='".getLabel("close_window")."' onclick='window.close();' />";
		print "</div>";
		print "</body>";
		print "</html>";
	}
	else
	{
		if($_POST['domain'])
		{
			// if user types in TLD into domain form, overwrite TLD here
			
			$tldOK = checkTLD($_POST['tld']);
			$tldc = $_POST['tld'];
			
			if($tldc == "all")
			{
				$tldslist = array_keys($domainInfo);
				$tldc = $tldslist[0];
			}
			if(!$_COOKIE['cjwhois_searches'])
				$_COOKIE['cjwhois_searches'] = $_SESSION['cjwhois_searches'];
			if($maximumSearches && (($_COOKIE['cjwhois_searches']+1) >= $maximumSearches) && !isset($_SESSION['whois'][$GLOBAL_DOMAIN][$tldc]))
			{
				print "<p>".getLabel("maximum_searches_reached")."</p>";
				closeWhoisProgress();
			}
			else
			{
				if($GLOBAL_DOMAIN && $tldOK)
				{
					if ($_POST['tld'] == "all")
					{
						//$domainInfoFlipped = array_reverse($domainInfo, true);
						foreach($domainInfo as $tld => $attribs)
						{
							$fetch = getWhoisRecords($tld, $GLOBAL_DOMAIN, true);
							
							if($fetch == "adown")
								$results[$tld] = "adown";
							else
							{
								if($fetch)
									$results[$tld] = $fetch;
								else
									$results[$tld] = "available";
							}
							
						}
							
					}
					else
					{
						if($_POST['tld'])
						{
							
							$fetch = getWhoisRecords($_POST['tld'], $GLOBAL_DOMAIN, true);
							
							if($fetch == "adown")
								$results[$tld] = "adown";
							else
							{
								if($fetch)
									$results[$_POST['tld']] = $fetch;
								else
									$results[$_POST['tld']] = "available";
							}
						}	
					}
				}
				else
				{
					if(!$tldOK)
						print "<p>".getLabel("tld_not_supported")."</p>";
					else
						print "<p>".getLabel("domain_name_invalid")."</p>";
					closeWhoisProgress();
				}
			}
			
			if($results)
			{
				$resultsflipped = array_reverse($results, true); // flip results that come in backwards
				closeWhoisProgress();
				displayResultsTable($resultsflipped);
				print "<br /><br />";
				print "<div id='checkanotherform'>";
				renderForm(getLabel("check_another_label"));
				print "</div>";
			}
		}

	}

?>

In mijn formulier heb ik o.a. staan
PHP:
<?
session_start();
include("../config.php");
include("../whois.php");
?>
 
Hoi,

config.php
regel 12 tot 15

PHP:
# URL to send users to when the click the register button
# %domain% and %tld% are substituted with the searched-for domain and extension.
# example: $registerURL = "http://www.site.com/order.php?domain=%domain%%tld%";
$registerUrl = "http://www.domein.com/index.php?aid=102&page=order&domain=%domain%&tld=%tld%";
 
Jip,

Als iemand een domeinnaam heeft uitgezocht wil ik hebben dat deze waarde in een veld komt die mee gemaild wordt in het bestelformulier.
 
dus je wil een email versturen met daarin php/html,
heb je dan wel in je header staan:

Content-type: text/html; charset=iso-8859-1' . "\r\n"

of zo iets?

(ik kon zelf niet vinden waar je de mail verstuurd)
 
Hoi,

De waardes in een formulier, samen met naw zoals je normaal een formulier gebruikt of maakt.

Het enige wat mij niet lukt is om de waarde van de domeinnaam in het formulier te krijgen.
 
Dat heeft ecross je toch al in z'n eerste post verteld?

Je doet gewoon:

PHP:
echo '<input type="text" name="domain" value="' . $_GET[ 'domain' ] . '" />';

Als je dat script dan aanroept met:

script.php?domain=helpmij.nl

komt helpmij.nl in je inputveld te staan. Als dit niet is wat je bedoelt, mag je je vraag wel eens wat duidelijker formuleren.
 
zal proberen de vraag duidelijker te stellen.

whois.php is een script dat kijkt of een domeinnaam nog vrij is, deze zet hij in een tabel neer
achter deze tabel staat:
  • whois, indien bezet kun je zien wie de eigenaar is
  • registreren, indien de domeinnaam beschikbaar is.

Als iemand een willekeurig domeinnaam wilt vastleggen wil ik in het orderformulier alleen deze domeinnaam met extensie terug zien.
Hij of zij kan dan verder het orderformulier afmaken en eventueel diverse opties kiezen zoals volledige hosting, alleen registratie etc. etc.

Hoop dat ik het nu duidelijk heb uitgelegd en anders moet ik toch maar voor 10 pond het script kopen :mad:
 
In whois.php kun je dan toch gewoon links maken:

PHP:
if ( isFree ( $domein . '.nl' ) ) { // vervangen door je eigen checks om te kijken of een domein vrij is

  echo '<a href="order.php?domain=' . $domein . '.nl">Registreer</a>'; // order.php vervangen door je registratiepagina

}

en dan doe je op order.php (of hoe je order pagina ook heet):

PHP:
echo '<input type="text" name="domain" value="' . $_GET[ 'domain' ] . '" />';

Volgens mij kan hier toch echt niet zoveel bij misgaan hoor.
 
Thanks het werkt.

In whois.php heb ik dit aangepast.
dm.v. tld te gebruiken i.p.v .nl pakt die nu elke extensie mee.

PHP:
	if ( isFree ( $domein . 'tld' ) ) { 
 
 		 echo '<a href="../forms/index.php?domain=' . $domein . '.tld">Registreer</a>';
 
}

in order.php heb ik nu neergezet.
PHP:
<?php
echo '<input type="text" name="domain" size="50" readonly value="http://www.' . $_GET[ 'domain' ] . '.' . $_GET[ 'tld' ] . '" />';
?>
 
Laatst bewerkt:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan