473,320 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

contents of var changing, seemingly without reason

Please look at these few lines of code. You'll see that I keep echoing
out the variable $name. And each time, I'm getting the correct result.
But then, when it is used in an error statement, it is missing the
first letter. How can this be? Does anyone see a place where $name is
being changed? Below you can see the output.

// 04-26-04 - now we want just the name, without the parentheses.
$location1 = strpos($name, "(");
echo "here is the name: $name <br> ";
$location1 = $location1;
$name = substr($name, 0, $location1);
echo "here is the name: $name <br> ";
if (in_array($name, $allowedFunctions)) $allowed = true;
if ($allowed) {
echo "here is the name: $name <br> ";
$this->import($name, " in checkTemplateForAllowedFunctions(), in
the class McControllerForAll.");
echo "here is the name: $name <br> ";
} else {
echo "here is the name: $name <br> ";
echo "Sorry, but we did not recognize the name of a PHP function
in the template or arrangement we were asked to show. We were given
'$name', which we did not recognize as being in the official list.
These are the officially allowed PHP functions: ";
reset($allowedFunctions);
while (list($key, $val) = each($allowedFunctions)) {
echo "$val \n<br />";
}
die();
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Below is the output>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


here is the name: showNav2(4);
here is the name: showNav2
here is the name: showNav2
here is the name at the top of import(): showNav2 here is the name:
showNav2
Sorry, but we did not recognize the name of a PHP function in the
template or arrangement we were asked to show. We were given
'howNav2', which we did not recognize as being in the official list.
These are the officially allowed PHP functions:
McDatastoreConnectorMySql
McDatastoreForSessionInfoMySql
McDatastorePageInfoMySql
McDatastoreResultsMySql
McQueryObjectMySqlGetDefaultTemplateId
addBuiltInLinkToNavForm
bulkInputOfList
checkPassword
Jul 17 '05 #1
1 1613

"lawrence" <lk******@geocities.com> wrote in message
news:da**************************@posting.google.c om...
Please look at these few lines of code. You'll see that I keep echoing
out the variable $name. And each time, I'm getting the correct result.
But then, when it is used in an error statement, it is missing the
first letter. How can this be? Does anyone see a place where $name is
being changed? Below you can see the output.
<snip>

Weird - it works for me. If you snipped this code out and did it standalone,
does it still fail on your machine? Here's what I used (the concatenation in
the final echo is for ease of reading, it works regardless whether it's all
on one line or this way):

<?php
$name="showNav2(4)";
$location1 = strpos($name, "(");
echo "here is the name: $name <br> ";
$location1 = $location1;
$name = substr($name, 0, $location1);
echo "here is the name: $name <br> ";

echo "here is the name: $name <br> ";
echo "Sorry, but we did not recognize the name of a PHP function ".
"in the template or arrangement we were asked to show. We were given ".
"'$name', which we did not recognize as being in the official list. ".
"These are the officially allowed PHP functions: ";?


Garp
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carl | last post by:
I'm trying to select, with the mouse, a cell within a flexgrid that I've created, and copying the contents of that cell to the clipboard. I've tried using the Mousecol and Mouserow properties to...
0
by: syed_saqib_ali | last post by:
Please take a look at and run the code snippet shown below. It creates a canvas with vertical & Horizontal scroll-bars. If you shrink the window to smaller than the area of the canvas, the...
3
by: Francis Hwang | last post by:
Hi, Maybe this is a newbie question, but: Is there a way to output an element's contents -- including contained nodes and free-form text -- without the containing tags? I can imagine that...
16
by: chris | last post by:
im new to javascript but slowly getting better what i want to do is have some text on the screen and when an event happens for example click a button the text would change to what i want. how...
4
by: ioneabu | last post by:
The below function attempts to remove the contents of one form and replace with the contents of another. Is this not possible? Why not? It will make a big difference in the final solution to a...
3
by: Bernd Giegerich | last post by:
Hi, we had a strange problem with DB2 8.2 Enterprise Edition on Windows 2003 (Standard) Server. We installed DB2 8.2 (8.1.7) directly on a naked W2K3 system (no migration, no update -> no...
3
by: Michael | last post by:
Hi everyone, I am trying to change the field names for a table that is being exported via Excel. Its a spreadsheet that our National Office sends us but even after promise after promise they...
10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
1
by: Howard Charles | last post by:
Is there any way to change the contents of the location bar, such as to add something like "?c=1" to the end of the url, without causing the web page to reload itself? Howard Charles
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.