This topic is locked

Direct access (HTML) to certain records

1/7/2007 11:40:16 AM
PHPRunner General questions
A
asimha author

Hi, great product once again!
I have a large table containing items by year. Is it possible to call a view page with a parameter (i.e show me all the items for 1980 for example) without using the Advanced Search, using HTML ?
Thank you!

Andre

T
thesofa 1/7/2007

I use javascript to call a page directly after I add a record, so the record is added, then I use a function to get the ID (primary key) if the record, which I then pass to a javascript call to the edit page, so I can use the onload facility to look for other records in that name.

It works from this code

function AfterAdd()

{
//********** Custom code ************

// put your custom code here

global $conn;

//get current record

$where="select * from detentions where depreset=4";//detentions is table name, depreset is a field name i use for flagging

$rs1 = db_query($where,$conn);

$data1 = db_fetch_array($rs1);

$det_id = $data1["ID"];
//********** Redirect to another page ************
?>

<script language="javascript">

window.location = "detentions_edit.php?editid=<?php echo($det_id);?>";

</script>

<?php

exit();

}



perhaps you could use something like this for your needs?

HTH

Sergey Kornilov admin 1/7/2007

Andre,
run a basic search that returns you all records that belong to year 1980.

You can use the URL search page generates to point users directly to search results. This link can be placed to any HTML file.

A
asimha author 1/7/2007

Andre,

run a basic search that returns you all records that belong to year 1980.

You can use the URL search page generates to point users directly to search results. This link can be placed to any HTML file.


Sergei you're a star - and the result is impeccable !!

Thanks a bunch!

Andre
PS. I have a couple more questions up my sleeve :-)

L
larsonsc 1/7/2007

Is there a way to pass the just added record the printer-friendly view since the printer-friendly URL doesn't have a parameter at the end of it? This would make some things easier for my users since they are required to print a copy of a particular record when it is added.

Sergey Kornilov admin 1/7/2007

Printer-frienly page is not designed to print a single record.

You can redirect user to the View page that points to the record that was added.
PS. If your question is not related to existing thread you need to start a new one.

L
larsonsc 1/7/2007

Sorry, I thought it was sort of related since I was asking how to redirect to a particular page/view.