MAR Model

I’m trying to to do some basic formatting and styling of the email I
receive. Right now it’s all in one paragraph and I would like the
Message variable on a new line like the following (includes style tags
for clarity):

<b>Sender's Name</b> at <b>Sender's Email</b> has contacted you.
<b>Message:</b> My message

Here’s how it looks currently:

else{
       $to = 'email@hidden'; //your admin address
       $subject = 'Whoo-hoo!';
       $body = $this->name . ' at ' . $this->email . ' has contacted  
you. ' . 'Message: ' . $this->message . ' View it at http:// 
mysite.mobi.';
//  $body = print_r($this,true); //basic awful-looking text version of  
mar. debugging code.
       mail($to,$subject,$body,'From: email@hidden','email@hidden 
');
       if(!is_null($strSession)) $_SESSION[$strSession] =  
flash($strMessage);
       return header('Location: ' . $strRedirectTo);
}

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

To force line-breaks in a plain-text e-mail, just add newlines, or to
be completely pedantic, return + newline. Try this:

define ('MAIL_BREAK',"rn");

Note that I used double-quotes rather than single-quotes, that’s
significant when you’re creating something with these backslash
“escape” characters like r, n, or t.

Now in your message, as you’re composing it, just inline one or two
MAIL_BREAK characters wherever you want a “paragraph”. It’s also
canonical to put two of these at the end of the body of your message.

$body = 'Howdy from the server.' . MAIL_BREAK . MAIL_BREAK . 'This is  
a new paragraph';

Walter

On Mar 13, 2011, at 10:31 AM, Todd wrote:

I’m trying to to do some basic formatting and styling of the email I
receive. Right now it’s all in one paragraph and I would like the
Message variable on a new line like the following (includes style
tags for clarity):

<b>Sender's Name</b> at <b>Sender's Email</b> has contacted you.
<b>Message:</b> My message

Here’s how it looks currently:

else{
     $to = 'email@hidden'; //your admin address
     $subject = 'Whoo-hoo!';
     $body = $this->name . ' at ' . $this->email . ' has contacted  
you. ' . 'Message: ' . $this->message . ' View it at http://mysite.mobi 
.';
//  $body = print_r($this,true); //basic awful-looking text version  
of mar. debugging code.
     mail($to,$subject,$body,'From: email@hidden','email@hidden 
');
     if(!is_null($strSession)) $_SESSION[$strSession] =  
flash($strMessage);
     return header('Location: ' . $strRedirectTo);
}

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

Does “define (‘MAIL_BREAK’,“rn”);” get added to the model or
controller? No matter what I try I keep breaking it.

Todd

On Mar 13, 2011, at 11:35 AM, Walter Lee Davis wrote:

To force line-breaks in a plain-text e-mail, just add newlines, or
to be completely pedantic, return + newline. Try this:

define (‘MAIL_BREAK’,“rn”);

Note that I used double-quotes rather than single-quotes, that’s
significant when you’re creating something with these backslash
“escape” characters like r, n, or t.

Now in your message, as you’re composing it, just inline one or two
MAIL_BREAK characters wherever you want a “paragraph”. It’s also
canonical to put two of these at the end of the body of your message.

$body = 'Howdy from the server.' . MAIL_BREAK . MAIL_BREAK . 'This  
is a new paragraph';

On Mar 13, 2011, at 10:31 AM, Todd wrote:

I’m trying to to do some basic formatting and styling of the email
I receive. Right now it’s all in one paragraph and I would like the
Message variable on a new line like the following (includes style
tags for clarity):

<b>Sender's Name</b> at <b>Sender's Email</b> has contacted you.
<b>Message:</b> My message

Here’s how it looks currently:

else{
    $to = 'email@hidden'; //your admin address
    $subject = 'Whoo-hoo!';
    $body = $this->name . ' at ' . $this->email . ' has contacted  
you. ' . 'Message: ' . $this->message . ' View it at http://mysite.mobi 
.';
//  $body = print_r($this,true); //basic awful-looking text version  
of mar. debugging code.
    mail($to,$subject,$body,'From: email@hidden','email@hidden 
');
    if(!is_null($strSession)) $_SESSION[$strSession] =  
flash($strMessage);
    return header('Location: ' . $strRedirectTo);
}

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


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You could put it in your config file, or pretty much anywhere. When
you say it keeps breaking, what is happening for you? Try putting it
just ahead of the line where you use it.

Walter

On Mar 13, 2011, at 5:34 PM, Todd wrote:

Does “define (‘MAIL_BREAK’,“rn”);” get added to the model or
controller? No matter what I try I keep breaking it.

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

When you say it keeps breaking, what is happening for you?

I kept getting:

Parse error: syntax error, unexpected ‘.’

But now that I put it directly above where I’m using it in the model
it works as expected. Thank you. As for adding a bold style to a
variable, eg, $this->email . ’ has contacted you. ’ . , it does throw
an error. Is it possible to do this?

T.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can’t use HTML in a plain text e-mail, so no you can’t do that
sort of thing without a lot of extra plumbing.

Walter

On Mar 13, 2011, at 8:20 PM, Todd wrote:

As for adding a bold style to a variable, eg, $this->email . ’ has
contacted you. ’ . , it does throw an error. Is it possible to do
this?


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So close…

The form works and submits to the db as expected (that part was easy-
breezy). Upon successful submission I was originally redirecting to a
non-MAR controlled success page (success.php) but I want to pass the
“name” variable to the success page so I created a “success” template
and partial (_success.php) and placed them in the “views” directory.
So far so good. Here’s where it gets sketchy: I then created a new
“case” named “success” in the controller which, I’m sure, has screwy
syntax; no doubt I have unnecessary and duplicate stuff in the
controller. In short the name variable is not being passed.

Todd

The current controller:

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = '' . $mar->h('name') . '.';
			$mar->manage_result('_flash','flash',$message,'');
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$page_header = '';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
		# code...
		if($mar = ActiveRecord::FindById('mar',$id)){
			$page_title = 'Connection Complete';
			$page_header = '';
			$message = '' . $mar->h('name') . '';
			$mar->manage_result('_flash','flash',$message,'');
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$out .= render_partial('success',$mar);
		include(APP_ROOT . '/views/success.php');
		break;
}
?>

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yeah, there’s a couple things I’m not clear about here. First, are you
posting to this or redirecting to it after a successful post to a
different controller path? If you’re not posting to it, then the
manage_result() method is completely wrong for this. Remember, its job
is to look and see if there are errors on the model. If there are,
then the errors are converted into a local (non-session-based flash
message) and the form reloads itself. If there aren’t any errors, then
the session-based flash message is filled with the success message
(third variable) and the user is redirected to the success path
(fourth variable). You have this fourth variable blank, which is
probably going to fail in Microsoft browsers, and is ambiguous anyway.

On Mar 13, 2011, at 10:22 PM, Todd wrote:

case ‘success’:
# code…
if($mar = ActiveRecord::FindById(‘mar’,$id)){
$page_title = ‘Connection Complete’;
$page_header = ‘’;
$message = ‘’ . $mar->h(‘name’) . ‘’;
$mar->manage_result(’_flash’,‘flash’,$message,’’);
}
if(isset($_SESSION[‘flash’])){
$mar->_flash = $_SESSION[‘flash’];
unset($_SESSION[‘flash’]);
}
$out .= render_partial(‘success’,$mar);
include(APP_ROOT . ‘/views/success.php’);
break;

Then, try this:

case 'success':
	# code...
	if($mar = ActiveRecord::FindById('mar',$id)){
		$page_title = 'Connection Complete';
		$page_header = '';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$out .= render_partial('success',$mar);
		include(APP_ROOT . '/views/success.php');
	}
	break;

and back in whatever method you are using to vet your form submission,
be sure to change the success path to /yourmodel/success/$mar->id so
this case will be evaluated.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, the intent was to, upon successful submission, redirect to a
separate success page and in turn pass the “name” variable along to it.

Originally I didn’t care for the success flash message to appear on
the form page, hence the redirect, but at this point I’m ok with just
getting something to work, be it the flash success message posting to
the form page, just like the errors do, or passing the variable to the
success page (the redirect part works fine). Either is good. I can get
certain aspects to work but seem to lose the error checking in the
process. Very frustrated with myself.

Tried your suggestion but still I can’t get it to work.

Todd

On Mar 14, 2011, at 9:04 AM, Walter Lee Davis wrote:

First, are you posting to this or redirecting to it after a
successful post to a different controller path? If you’re not
posting to it, then the manage_result() method is completely wrong
for this.

On Mar 13, 2011, at 10:22 PM, Todd wrote:

Then, try this:

case 'success':
	# code...
	if($mar = ActiveRecord::FindById('mar',$id)){
		$page_title = 'Connection Complete';
		$page_header = '';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$out .= render_partial('success',$mar);
		include(APP_ROOT . '/views/success.php');
	}
	break;

and back in whatever method you are using to vet your form
submission, be sure to change the success path to /yourmodel/success/
$mar->id so this case will be evaluated.

Walter


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

On Mar 14, 2011, at 11:19 AM, Todd wrote:

Well, the intent was to, upon successful submission, redirect to a
separate success page and in turn pass the “name” variable along to
it.

Originally I didn’t care for the success flash message to appear on
the form page, hence the redirect, but at this point I’m ok with
just getting something to work, be it the flash success message
posting to the form page, just like the errors do, or passing the
variable to the success page (the redirect part works fine). Either
is good. I can get certain aspects to work but seem to lose the
error checking in the process. Very frustrated with myself.

Tried your suggestion but still I can’t get it to work.

In the case where you are dealing with the $_POST, try using this set
of options to the manage_result function:

$mar->manage_result('_flash','flash',$message,'/mar/success/' . $mar- 

id);

Then on your success.php page or your _success.php partial (which you
probably don’t need since you already have the different outer
template, no need to make a separate partial for the middle of that if
you’re not loading it into the $out variable for playback within your
one outermost layout index.php file) then just don’t include the <?=
$flash ?> part, and you won’t see any flash messages. manage_result
will still set them, but you just don’t need to show them to the user.

Walter

Todd

On Mar 14, 2011, at 9:04 AM, Walter Lee Davis wrote:

First, are you posting to this or redirecting to it after a
successful post to a different controller path? If you’re not
posting to it, then the manage_result() method is completely wrong
for this.

On Mar 13, 2011, at 10:22 PM, Todd wrote:

Then, try this:

case 'success':
	# code...
	if($mar = ActiveRecord::FindById('mar',$id)){
		$page_title = 'Connection Complete';
		$page_header = '';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$out .= render_partial('success',$mar);
		include(APP_ROOT . '/views/success.php');
	}
	break;

and back in whatever method you are using to vet your form
submission, be sure to change the success path to /yourmodel/
success/$mar->id so this case will be evaluated.

Walter


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


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

In the case where you are dealing with the $_POST, try using this
set of options to the manage_result function:

$mar->manage_result(’_flash’,‘flash’,$message,’/mar/success/’ .
$mar->id);

First, when I add the above (see below) I get this error, “The
requested URL //routing.php//success/72/ was not found on this server.”

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = $mar->h('name');
			$mar->manage_result('_flash','flash',$message,'/mar/success/' .  
$mar->id);
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
	# code...
		$page_title = 'Connection Complete';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		include(APP_ROOT . '/views/success.php');
	break;
}
?>

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You have larger issues then, probably in your routing.php file. Are
you serving this from a subfolder or from a domain? What is your model
named? I used mar, but realize you may have made that up for the
example. use model/action/id to create the link. If you have a recent
version of the MAR framework, like the fork that’s in Generate, then
there’s the ultra-succinct $model->link_to(‘verb’) helper function.

Walter

On Mar 14, 2011, at 1:14 PM, Todd wrote:

In the case where you are dealing with the $_POST, try using this
set of options to the manage_result function:

$mar->manage_result(’_flash’,‘flash’,$message,’/mar/success/’ .
$mar->id);

First, when I add the above (see below) I get this error, “The
requested URL //routing.php//success/72/ was not found on this
server.”

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = $mar->h('name');
			$mar->manage_result('_flash','flash',$message,'/mar/success/' .  
$mar->id);
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
	# code...
		$page_title = 'Connection Complete';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		include(APP_ROOT . '/views/success.php');
	break;
}
?>

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

public_html
mar folder
controllers
models
routing.php
views
etc.

The model name is “mar” and the model file is named “mar_model.php”.

MAR v0.6

<?php
// this is the front controller, responsible for loading the proper  
controller and passing the basic routing information
require_once('config.inc.php');
$segments = explode('/',str_replace('index.php','', 
$_SERVER['REQUEST_URI']));
array_shift($segments); //first element is always blank
array_shift($segments); //remove second level, since you are running  
in the /mar folder -- also this is fixed in the index.php view
// array_shift($segments);
$model = (isset($segments[0]) && !empty($segments[0])) ?  
$segments[0] : 'mar'; //if a particular model is not chosen, default  
to this
$verb = (isset($segments[1]) && !empty($segments[1])) ? $segments[1] :  
'index'; //if a particular action is not requested, default to this
if(isset($segments[2]) && !empty($segments[2])) {
	if(strpos($segments[2],'-') !== false) $segments[2] =  
substr($segments[2], 0, strpos($segments[2],'-'));
	$id =  (int) preg_replace('/[^d]/','',$segments[2]);
}
$extra = (isset($segments[3]) && !empty($segments[3])) ?  
$segments[3] : '';
$models = scandir(APP_ROOT . '/models');
foreach($models as $m){
	if(!is_dir(APP_ROOT . '/models/' . $m) && file_exists(APP_ROOT . '/ 
models/' . $m)) include(APP_ROOT . '/models/' . $m);
}
if (file_exists(APP_ROOT . '/controllers/' . $model .  
'_controller.php')) include(APP_ROOT . '/controllers/' . $model .  
'_controller.php');
?>

T

On Mar 14, 2011, at 12:20 PM, Walter Lee Davis wrote:

You have larger issues then, probably in your routing.php file. Are
you serving this from a subfolder or from a domain? What is your
model named?

On Mar 14, 2011, at 1:14 PM, Todd wrote:

In the case where you are dealing with the $_POST, try using this
set of options to the manage_result function:

$mar->manage_result(’_flash’,‘flash’,$message,’/mar/success/’ .
$mar->id);

First, when I add the above (see below) I get this error, “The
requested URL //routing.php//success/72/ was not found on this
server.”

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = $mar->h('name');
			$mar->manage_result('_flash','flash',$message,'/mar/success/' .  
$mar->id);
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
	# code...
		$page_title = 'Connection Complete';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		include(APP_ROOT . '/views/success.php');
	break;
}
?>

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


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What does your manage_result function look like?

Walter

On Mar 14, 2011, at 1:29 PM, Todd wrote:

public_html
mar folder
controllers
models
routing.php
views
etc.

The model name is “mar” and the model file is named “mar_model.php”.

MAR v0.6

<?php
// this is the front controller, responsible for loading the proper  
controller and passing the basic routing information
require_once('config.inc.php');
$segments = explode('/',str_replace('index.php','', 
$_SERVER['REQUEST_URI']));
array_shift($segments); //first element is always blank
array_shift($segments); //remove second level, since you are running  
in the /mar folder -- also this is fixed in the index.php view
// array_shift($segments);
$model = (isset($segments[0]) && !empty($segments[0])) ?  
$segments[0] : 'mar'; //if a particular model is not chosen, default  
to this
$verb = (isset($segments[1]) && !empty($segments[1])) ?  
$segments[1] : 'index'; //if a particular action is not requested,  
default to this
if(isset($segments[2]) && !empty($segments[2])) {
	if(strpos($segments[2],'-') !== false) $segments[2] =  
substr($segments[2], 0, strpos($segments[2],'-'));
	$id =  (int) preg_replace('/[^d]/','',$segments[2]);
}
$extra = (isset($segments[3]) && !empty($segments[3])) ?  
$segments[3] : '';
$models = scandir(APP_ROOT . '/models');
foreach($models as $m){
	if(!is_dir(APP_ROOT . '/models/' . $m) && file_exists(APP_ROOT . '/ 
models/' . $m)) include(APP_ROOT . '/models/' . $m);
}
if (file_exists(APP_ROOT . '/controllers/' . $model .  
'_controller.php')) include(APP_ROOT . '/controllers/' . $model .  
'_controller.php');
?>

T

On Mar 14, 2011, at 12:20 PM, Walter Lee Davis wrote:

You have larger issues then, probably in your routing.php file. Are
you serving this from a subfolder or from a domain? What is your
model named?

On Mar 14, 2011, at 1:14 PM, Todd wrote:

In the case where you are dealing with the $_POST, try using this
set of options to the manage_result function:

$mar->manage_result(’_flash’,‘flash’,$message,’/mar/success/’ .
$mar->id);

First, when I add the above (see below) I get this error, “The
requested URL //routing.php//success/72/ was not found on this
server.”

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = $mar->h('name');
			$mar->manage_result('_flash','flash',$message,'/mar/success/' .  
$mar->id);
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
	# code...
		$page_title = 'Connection Complete';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		include(APP_ROOT . '/views/success.php');
	break;
}
?>

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


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

What does your manage_result function look like?

Wasn’t sure which one you wanted but here they are.

helpers.inc file:

function manage_result($strLocal,$strSession,$strMessage='Changes  
saved',$strRedirectTo){
		$strRedirectTo = (substr($strRedirectTo,0,7) == 'http://') ?  
$strRedirectTo : BASE_URL . $strRedirectTo;
		$errors = $this->get_errors();
		if(is_array($errors) && count($errors) > 0){
			return $this->$strLocal = flash($errors,'error');
		}else{
			if(!is_null($strSession)) $_SESSION[$strSession] =  
flash($strMessage);
			return header('Location: ' . $strRedirectTo);
		}
		return false;
	}

model file:

function manage_result($strLocal,$strSession,$strMessage='Changes  
saved',$strRedirectTo){
		$strRedirectTo = (substr($strRedirectTo,0,7) == 'http://') ?  
$strRedirectTo : BASE_URL . $strRedirectTo;
		$errors = $this->get_errors();
		if(is_array($errors) && count($errors) > 0){
			return $this->$strLocal = flash($errors,'error');
		}

controller:

<?php
switch ($verb) {
case 'create':
	default:
		# code...
		$mar = ActiveRecord::Create('mar');
		if(isset($_POST['submit'])){
			$mar->populate(clean($_POST));
			$mar->save();
			$message = $mar->h('name');
			$mar->manage_result('_flash','flash',$message,'/mar/success/' .  
$mar->id);
		}
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$page_title = 'Connect';
		$out .= render_partial('form',$mar);
		include(APP_ROOT . '/views/index.php');
		break;
case 'success':
	# code...
		$page_title = 'Connection Complete';
		$message = '' . $mar->h('name') . '';
		if(isset($_SESSION['flash'])){
			$mar->_flash = $_SESSION['flash'];
			unset($_SESSION['flash']);
		}
		$out .= render_partial('success',$mar);
		include(APP_ROOT . '/views/success.php');
	break;
}
?>

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, that was it. Now what is BASE_URL set to in your config.inc.php?

We’re closing in on the answer here…

Walter

On Mar 14, 2011, at 1:51 PM, Todd wrote:

What does your manage_result function look like?

Wasn’t sure which one you wanted but here they are.

helpers.inc file:


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, that was it. Now what is BASE_URL set to in your config.inc.php?

define(‘BASE_URL’,‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/connect/’);

To clarify, “connect” is the name of the MAR application folder I
referred to in the previous email.

public_html
connect
controllers
models
etc.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

All right, then try removing the forward slash from the beginning of
the URL, so your redirect to goes to ‘mar/success/’ . $mar->id.

Walter

On Mar 14, 2011, at 2:25 PM, Todd wrote:

Yes, that was it. Now what is BASE_URL set to in your config.inc.php?

define(‘BASE_URL’,‘http://’ . $_SERVER[‘HTTP_HOST’] . ‘/connect/’);

To clarify, “connect” is the name of the MAR application folder I
referred to in the previous email.

public_html
connect
controllers
models
etc.


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

All right, then try removing the forward slash from the beginning of
the URL, so your redirect to goes to ‘mar/success/’ . $mar->id.

Same or similar error: The requested URL //routing.php//success/80/
was not found on this server.

As an aside, I’m not entirely certain the success.php page in the
“views” folder is being seen by the app.

And I thought getting the “success” part dialed in would be the easy
part compared to getting the submissions into the db. Was I wrong. ; )

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for your suggestions and help Walter.

It’s still not working the way I want (though it does work) despite
some incorrect syntax. If anyone has been following and wants to take
a look at the key files then have at it. I’m taking a break.

http://www.xiiro.com/MAR.zip

Todd


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options