473,325 Members | 2,608 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,325 software developers and data experts.

Unexpected : error

Claus Mygind
571 512MB
I cannot figure out why I am getting this error

Parse error</b>: syntax error, unexpected ':'.....

in the following code.

Expand|Select|Wrap|Line Numbers
  1. $cStartAt   = ( isset($oCGI['startAt']) ) ?intval($oCGI['startAt'] :0;
  2.  
I want to test for the existence of the variable $oCGI['startAt'] and if found use the value or else set the starting value at 0 if not found.

The error occurs when $oCGI['startAt'] is not found.

I also tried this
Expand|Select|Wrap|Line Numbers
  1.     $cStartAt   = ( array_key_exists( 'startAt', $oCGI) ) ?intval($oCGI['startAt'] :0;
  2.  
What options do I have?
Mar 28 '11 #1

✓ answered by Rabbit

You didn't close your parentheses for the intval function.

3 1165
Rabbit
12,516 Expert Mod 8TB
You didn't close your parentheses for the intval function.
Mar 28 '11 #2
Claus Mygind
571 512MB
Boy I hate it when you spend an hour on simple over sight like the missing ")" in the intval($oCGI['startAt']

Expand|Select|Wrap|Line Numbers
  1. $cStartAt   = ( isset($oCGI['startAt']) ) ?intval($oCGI['startAt']) :0;
Mar 28 '11 #3
Claus Mygind
571 512MB
Thanks for the fix. Figured it out just as you posted the response.
Mar 28 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
1
by: Angel | last post by:
I'm trying to connect to a fixed IP address (eg. http://10.60.903.50/TempFile) in order to retrieve one accii line of text in TempFile. I try to read the information with this code: string...
1
by: Fredrik L | last post by:
Hi, We have an application outside the firewall who talks to a webservice inside the firewall. 9 times of 10 this works, but sometimes we got the error "The underlying connection was closed: An...
5
by: Vijayakrishna Pondala | last post by:
Hi, We are using the following error randomly, when accessing a webservice method/servlet hosted on JBoss application server: The underlying connection was closed: An unexpected error occurred...
0
by: tharika | last post by:
Hi, We have an ASP.NET web application hosted on a development server, that invokes web services hosted on an offshore server in India, both being on the same intranet domain. The default...
4
by: Matthew.DelVecchio | last post by:
hello, i am developing an ASP.NET web app that consumes a 3rd party vendor webservice. it is my first one so while ive done my homework, im not an expert on the matter. our partner's...
8
by: D & J G | last post by:
A VB6 program that I created has been installed on a wide range of computers and networks without any problems. Win 95, Win 98 and XP so far.. Occasionally, however, the function refuses to start...
11
by: MLH | last post by:
Private Sub ButtonP_Click() On Error GoTo Err_ButtonP_Click Dim ThisForm As String ThisForm = Me.Name Exit_ButtonP_Click: Exit Sub Err_ButtonP_Click: Dim r As String, k As String, Message3...
0
by: pct | last post by:
Please help !!!! while preparing visual basic 6.0 setup with crystal reports 8.5, once I clicked on Finish I got mesage 'unexpected error 28 : out of stack space', on the net I found the...
1
by: Mrozik | last post by:
Hi! I have a problem - after deploying application in client environment, on some client machines occured error. Environment: App server: ASP.NET WebService/Win 2003/ secured SSL (.NET 2.0)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.