close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi Update Record with parameter in the goto throws a Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

Thread began 7/22/2016 5:03 pm by Ramiro | Last modified 7/25/2016 12:52 pm by Ray Borduin | 278 views | 1 replies |

Ramiro

MySQLi Update Record with parameter in the goto throws a Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)

Hello there:

When I try to load the update record form page in order to enter the data to update, I'm getting the following parse error on the $UpdateGoTo line:

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\wamp\www\prueba_update.php on line 18

I'm almost sure the issue is related to the way the behavior constructs the goto url string, since this only happens when I'm passing a parameter on the "After updating, goto:" popup window that is built by Dreamweaver CS6 parameter button generator.

I tried avoiding to pass any parameters in the goto and adding it by hand after the behavior generated the update code and of course it works, but (I assume) because of the handcoding, the server behaviors panel stops showing the update behavior after I altered the original code.

Update Note: Same thing is happening with de MySQLi Insert Record behaviors.

This is the page code:

<?php require_once('Connections/conn.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/queryobj.php'); ?>
<?php
$rsGrupo = new WA_MySQLi_RS("rsGrupo",$conn,1);
$rsGrupo->setQuery("SELECT * FROM modulos_sistema_grupos WHERE id_modulo_sistema_grupo = ?");
$rsGrupo->bindParam("i", "".(isset($_GET['grupo'])?$_GET['grupo']:"") ."", "-1"); //colname
$rsGrupo->execute();
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($conn);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "modulos_sistema_grupos";
$UpdateQuery->bindColumn("orden", "i", "".((isset($_POST["orden"]))?$_POST["orden"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("id_modulo_sistema_grupo", "=", "i", "".((isset($_POST["grupo"]))?$_POST["grupo"]:"") ."");
$UpdateQuery->execute();
$UpdateGoTo = "sistema_grupos.php?modulo=\" . echo((isset($_POST[\"modulo\"]))?$_POST[\"modulo\"]:\"\") . \"";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
</head>

<body>
<form name="form1" method="post" action="">
<table>
<tr>
<td>Orden:</td>
<td><input name="orden" type="text" id="orden" value="<?php echo($rsGrupo->getColumnVal("orden")); ?>"></td>
</tr>
<tr>
<td><input name="modulo" type="text" id="modulo" value="<?php echo $_GET['modulo']; ?>">
<input name="grupo" type="text" id="grupo" value="<?php echo $_GET['grupo']; ?>"></td>
<td><input type="submit" name="button" id="button" value="Enviar"></td>
</tr>
</table>
</form>
</body>
</html>

Thanks,
Ramiro.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like the go to page code got improperly encoded. It should be:

$UpdateGoTo = "sistema_grupos.php?modulo=" . echo((isset($_POST["modulo"]))?$_POST["modulo"]:"") . "";

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...