Todd1
(Todd)
October 29, 2011, 7:08pm
1
Submitting an empty search form throws errors. I’ve looked at the files in question though I haven’t been able to sort it out.
http://xiiro.com/dev/MAR/admin/
Todd
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
waltd
(Walter Davis)
October 29, 2011, 7:22pm
2
What version of MAR and what does your search method look like in PHP?
Walter
On Oct 29, 2011, at 3:08 PM, Todd wrote:
Submitting an empty search form throws errors. I’ve looked at the files in question though I haven’t been able to sort it out.
http://xiiro.com/dev/MAR/admin/
Todd
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
waltd
(Walter Davis)
October 29, 2011, 7:25pm
3
One method that can solve this sort of problem very easily, no changes elsewhere, is to condition your search action on a non-empty input to the search field:
if(isset($_GET['search']) &&
!empty($_GET['search'])){
#do your search thing here
}
Walter
On Oct 29, 2011, at 3:08 PM, Todd wrote:
Submitting an empty search form throws errors. I’ve looked at the files in question though I haven’t been able to sort it out.
http://xiiro.com/dev/MAR/admin/
Todd
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Todd1
(Todd)
October 29, 2011, 7:26pm
4
What version of MAR and what does your search method look like in PHP?
v0.6
case 'index':
default:
# code...
if(isset($_SESSION['flash'])){
$flash = $_SESSION['flash'];
unset($_SESSION['flash']);
}
if(isset($_POST['q'])){
$list = ActiveRecord::PublicSearch('mar',$_POST['q']);
$page_title = 'Search Results';
$page_header = 'search results';
$out .= '<p class="global_search"><a href="' . BASE_URL . 'mar/index">Back to List</a></p>';
$count = count($list);
$out .= '<div class="search_results"><span class="number">' . number_format($count) . '</span> ' . pluralize('result',$count) . ' for the search string "' . h($_POST['q']) . '"</div>';
if($count == 0) $out .= '<p class="search_error">Oops, please search again with a different term.</p>';
}else{
$list = ActiveRecord::FindAll('mar','1=1','added_at DESC');
$page_title = 'Connections';
// $page_header = '';
}
$total = ActiveRecord::Count('mar');
foreach($list as $person) {
$out .= '<div class="' . alternate() . ' entry"><span class="name">' . $person->full_name() . '</span> ' .
$person->link_for('edit','first',array('text'=>'Edit')) . ' ' . $person->link_for('view','first',array('text'=>'View')) . ' <br/> ' . $person->added_at . '</div>';
}
$search_term = (isset($_POST['q'])) ? trim(strip_tags($_POST['q'])) : '';
include(APP_ROOT . '/views/index.php');
break;
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
waltd
(Walter Davis)
October 29, 2011, 7:29pm
5
Make that
if(isset($_POST['q']) && !empty($_POST['q'])){
Walter
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Todd1
(Todd)
October 29, 2011, 7:37pm
6
So this isn’t necessary?
if(isset($_GET[‘search’]) &&
!empty($_GET[‘search’])){
#do your search thing here
}
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
waltd
(Walter Davis)
October 29, 2011, 9:21pm
7
It is exactly what I meant, just different names for things. Our messages crossed a bit.
Walter
On Oct 29, 2011, at 3:37 PM, Todd wrote:
So this isn’t necessary?
if(isset($_GET[‘search’]) &&
!empty($_GET[‘search’])){
#do your search thing here
}
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Todd1
(Todd)
October 29, 2011, 10:13pm
8
Still throws the same error.
T.
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
waltd
(Walter Davis)
October 29, 2011, 10:19pm
9
Try this:
Walter
On Oct 29, 2011, at 6:13 PM, Todd wrote:
Still throws the same error.
T.
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Todd1
(Todd)
October 29, 2011, 11:16pm
10
Try this:
simplepastiefile.php · GitHub
Sadly no, same error.
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
Todd1
(Todd)
October 30, 2011, 12:05am
11
Nevermind. Operator error. It works.
Thank you
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options