PDA

View Full Version : Can I change input variables



James
08-02-2005, 06:16 PM
Hi - great script,

Can I change the input variable names and values? It would help to integrate with my current search forms. I tried changing in the search bar in config but that didn't work.

I'd like to change

<input type='hidden' name='page' value='WhoisSearch'>

to

<input type="hidden" name="c" value="1">


and

<input name='domain' type='text' value=''>

to

<input name="keywords" type='text' value="">

Patrick
08-04-2005, 11:56 PM
well, I suppose you could.

But first let me just make sure that you are not doing this for the wrong reasons. In fact, you really shouldn't ever have to change these variable names. For example, you could instead include the page (<?php include("/absolute/path/to/whois.php"); ?>).

But if you really want to, you can change them to whatever you want, and then open up whois.php and find:
$_REQUEST['var_name'] where var_name is, for example, 'domain', and replace it with whatever you change it to (for example, 'keywords').

There may need to be other changes in other files too, especially in display.php, where something like &amp;page=, &amp;domain=, etc can be found and will need to be changed.

James
08-05-2005, 08:20 AM
No luck yet.

I changed Search bar to

<form name='whois_search' method='get' action='[[site-url]]whois.php'>
<input type='hidden' name='c' value='1'>

<input name='keywords' type='text' value='[[user-domain]]' size="49">

James
08-05-2005, 08:21 AM
No luck yet.

I changed Search bar to

<form name='whois_search' method='get' action='[[site-url]]whois.php'>
<input type='hidden' name='c' value='1'>

<input name='keywords' type='text' value='[[user-domain]]' size="49">

James
08-05-2005, 08:22 AM
whois.php I changed to

$domains = explode("\n", str_replace("\r\n", "\n", $_REQUEST['keywords']));

James
08-05-2005, 08:24 AM
[sorry for multiple posts - for some reason board keeps cutting off message]

there was also $domain = $_REQUEST['domain'];

James
08-05-2005, 08:26 AM
in line 77 which I tried changing and leaving alone

James
08-05-2005, 08:27 AM
in display.php I changed

"whois.php?page=WhoisReport&amp;domain=" . $current_domain->getDomain() . "&amp;ext=" . $current_domain->getExt()

to
"whois.php?c=WhoisReport&amp;keywords=" . $current_domain->getDomain() . "&amp;ext=" . $current_domain->getExt()

--------

James
08-05-2005, 08:32 AM
and this is the comparison urls

page=WhoisSearch&domain=test&submit=Check+Availability

c=1&keywords=test&submit=Check+Availability

the second is my try - it just returns a blank space where the results should be

James
08-05-2005, 08:33 AM
looked to me like WhoisSearch needed to be replace by 1 somewhere in the script - but changing it back to WhoisSearch in search bar didn't help

c=WhoisSearch&keywords=test&submit=Check+Availability

still gave nothing

James
08-05-2005, 09:05 AM
okay - i'm taking it in stages now.

I have changed domains to keywords ok using whois.php and display.php.

It's the page and WhoisSearch variables that are not straightforward swaps

James
08-05-2005, 09:20 AM
ok - search and replace all WhoisSearch with 1 in whois.php dealt with that bit.

Now just to change page to c

James
08-05-2005, 09:27 AM
:) found it

$EP_Dev_Whois->navigate($_REQUEST['c']);

James
08-05-2005, 09:28 AM
[being cut off again]

...in line 22 whois.php

also change page= to c= in display.php

Thx for pointing me in the right direction, Patiek.

Regards,

James