Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3317 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi, I'd like my New Record.php  to advance to an Edit.php upon clicking submit on the New Record form.  I don't want to remain on the New Record.php, but doing otherwise gives me a 'no record created' message.  Here's an example of my New Record.php

Thanks!

newinputplayer.php

Posted

Change line 123 to:

$rec_id = $result->getLastRecord()->getRecordID();
header("Location: edit.php?id=".$rec_id."&message=Record was created successfully.");
die();

In your edit.php use the passed $_GET['id'] and $_GET['message'] to populate your form properly.

I hope this helps.
Posted

Also, change the first few lines - the redirect will fail as it is currently formatted - the gap between the two php snippets will cause the web server to claim data has already been sent:

 

<?php require('start.php');

$layout =& $fm->getLayout('mylayout');
$values = $layout->getValueList('programlist');

 

Posted

Thanks dwdata and web, that worked great!  I tried the same process to redirect from an edit page  to another page, but it didn't work.  here is some code and the entire page.  Is my redirect wrong?  Thanks!

if (FileMaker::isError($result)) 
            {
            $message = "<p>Error: " . $result->getMessage() . "</p>";
            exit;
            }
        else
            {
                $rec_id = $result->getRecordID();
header("Location: playeredit.php?id=" . $rec_id . "&message=SSV First Test Successful");
die();
    }

 

 

 

 

 

 

 

 

ratingtest1.php

Posted

Line 36 can be changed to:

$rec_id = $_POST['id'];

Hope this helps!

Posted (edited)

Looks like you need to shift your RESULT code check into the $_POST IF statement. Check out the mod I did.

 

ratingtest1-2.php

Edited by dwdata

This topic is 3317 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.