473,795 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 , $allowedFunctio ns)) $allowed = true;
if ($allowed) {
echo "here is the name: $name <br> ";
$this->import($name , " in checkTemplateFo rAllowedFunctio ns(), in
the class McControllerFor All.");
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($allowedF unctions);
while (list($key, $val) = each($allowedFu nctions)) {
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:
McDatastoreConn ectorMySql
McDatastoreForS essionInfoMySql
McDatastorePage InfoMySql
McDatastoreResu ltsMySql
McQueryObjectMy SqlGetDefaultTe mplateId
addBuiltInLinkT oNavForm
bulkInputOfList
checkPassword
Jul 17 '05 #1
1 1637

"lawrence" <lk******@geoci ties.com> wrote in message
news:da******** *************** ***@posting.goo gle.com...
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
5702
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 return the cell col and row index, but It doesn't seem to RETURN the cell ID but needs an argument identifying, seemingly the col and row repectively. Here's the test routine I set up just to see how the mousecol property worked but it genterates...
0
2040
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 scroll-bars work as advertised. That's great. However, if you click the Left Mouse button, it calls code which expands the width of the canvas by 100 pixels. The area being viewed expands correspondingly..... BUT I DON'T WANT IT TO!!
3
1909
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 this request might be against the spirit of XML in general, but the reason I'm trying to do this is that I want to use XSLT for simple generation of XHTML. Basically I want the page's contents in external files, then I want to include them into a...
16
2132
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 would i do this ??
4
13583
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 problem I am trying to solve. Thanks for any advice! wana
3
3855
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 leftovers from an older version on the system). After that, we had to change the IP address of the system. Same
3
3025
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 keep changing the field names which makes it nearly impossible to run any pre-generated queries etc. The solution really is to get someone to check the field names before importing the spreadsheet but I want to do it in code. I have written
10
15383
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 identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source of a query, either in the design grid or SQL display? I suppose I could copy the SQL into WordPad...
1
1579
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
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.