Parse Error: syntax error
Ive just installed php5 on a new development machine. Apache and MySQL are working and a test of php with a simple phpinfo() works ok.
I have transferred my php4 code to the new machine (I didnt expect it to work straight away, but I also didnt expect this error:
Parse Error: syntax error, unexpected $end in C:wwwphpSitemodulesuser.php on line 128
It happens on each and every php file with the line number indicated not actually e
|
PHP Syntax Formatting
Hey...So I have a function which breaks up a string..I would like to echo just a part of it...but it isnt working...how do I go about doing what I am trying to do here is my code to give you an idea: PHP Code: if($probe->getData() != null){ echo nodeEcho($probe->getData()); } function nodeEcho($str){ $array= split('.',$str,2); return $array[0]; } So each piece of da
|
Coding forum FAQ + Bookmarked threads
Ive just installed php5 on a new development machine. Apache and MySQL are working and a test of php with a simple phpinfo() works ok.
I have transferred my php4 code to the new machine (I didnt expect it to work straight away, but I also didnt expect this error:
Parse Error: syntax error, unexpected $end in C:wwwphpSitemodulesuser.php on line 128
It happens on each and every php file with the line number indicated not actually e
|
Collected solutions to common problems.
Salutations to the Forum,
Quote:
This thread is EXPERIMENTAL. The behaviour of this thread, the title of this thread, the contents of this thread, and this threads very existence may change without notice in future (in fact I hope it will. Except for the last bit. Cant edit something if its deleted).
The format is pretty simple. This thread contains links to other threads that discuss the problem in t
|
Simple PHP code help
I have written a flex application that sends XML to a php script which will then be inserted into a databse. The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working. I have written the post data to a text file and it is coming through. My php file is as follows PHP Code: <?php //Connect to the database $link = mysql_connect(localhost, root,
|
PHP Plugins System
Hi everyone,
I have a slight issue that I have been unable to resolve.
Firstly a little explanation, What this function does is pull off results from a table(tenants), specifically using 1 field(tenants_roomnum).
It *should* loop through the while statement and build a list of all rooms for the property and if there is a tenant assigned to that property append Room # with occupied.
I have narrowed down the problem to the while lo
|
Return to HOME page??????
I have written a flex application that sends XML to a php script which will then be inserted into a databse.
The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working.
I have written the post data to a text file and it is coming through.
My php file is as follows
PHP Code:
<?php
//Connect to the database
$link = mysql_connect(l
|
[RESOLVED] ZipArchive function problems
Hey, I cant figure out why this aint working...I am just trying to pass a php variable (string) into an onchange event...if i replace the variable with just a normal string, it works fine...
heres some code:
PHP Code:
$str = $node->getData(); //(this is the variable that doesnt work)
$toReturn = <div style=display:none; id=$nodeID>$space
<img src=images/plus.gif onclick=showHide($nodeChild); />
<label
|
Personal PHP Forum issue..
Im working on some PHP for a Wordpress site im working on. I built some sidebar content that Id like to hide on certain pages. I would need to specify the page ids in an IF statement of some kind. Im sure I could build it with a bunch of || (or) declarations but is there a way to do it nice in an array of some kind? I would put the ids in the array and then create an IF statement that cycled through the array to discover whether the current
|
[RESOLVED] Confusing Parse Error
I am receiving an error when I call my php file, from an external application:
I think that there is some kind of limit in the amount of data that can fit
into the header.
is there perhaps a header setting or better way,
preferably I do not want the data to be returned via the content.
Google does not seem to have answers either.
<?php
session_start();
header("SQL_RESULTS: SQL_RESULTS=$alist");
?>
Thankin
|
Help with base_64 decoding.
I am just wondering if anyone out there has a curl script that will log into the comcast website for the account management.
This is the only one that i can not figure out as it seems to go through various stages for the log in process that I cannot follow. This is the first part of the script that I am using, it works for everything else, but not for comast..
It then goes in into another post form with a ticketId and then it gets th
|
[RESOLVED] Using a variable in a $row-> call from sql is breaking the code
Hello,
In PHP and mysql I am creating a script that adds a new event on the command of the administartor. Everything in the script works fine apart from the create table script. No table is created. I added a die to the end of the query to show the mysql error and to check the table name is correct and this is what I get:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
|
Question about Endianness and byte length
Hi Guys,
Ive been working on a massive chat program for a few months and its just about finished. But Ive come to realize a big flaw.
Everything in my program is stored in mysql and the script itself is a php and ajax combo. But here is my problem.
There are public rooms and private rooms. Room files are the only thing in my program that are stored in flat files (text files) everything else is in mysql. With some of the features
|
Algorithm to display schedule?
I am trying to display the image from the link in the database. None of my attempts work (remmed out). I can click to view the image by my hyper link but I am not able to display the image..
Can anyone help out and tell me what syntax I should be using? The link will display like this -> file:///m:/Cop100/25836/109402.cpc
PHP Code:
<?php
$server_choice = $_GET[word];
$username=;
$password=;
$databa
|
Data Sets and XSLT
i have the following code and i need help in trying to count what is in the value.
Here is the code:
PHP Code:
do {
$myhash6[$row_get_Requestedby_Jun[Originator_Submitter]][] = $row_get_Requestedby_Jun[Requested_By];
} while ($row_get_Requestedby_Jun = mysql_fetch_assoc($get_Requestedby_Jun));
arsort ($myhash6);
|
[RESOLVED] need help with php update code
I am working on loggin into an internal site automatically and performing a search.
currently we do this with a perl script so I know it is possible.
in order to do this correctly on the system I am working with I need to do the following
1. login to site
2. receive and set a cookie from the system
3. perform search
I have logged into the site but when I do I receive the following response.
Code:
HttpMessage Object
|
[RESOLVED] remove item from session array
HELLO!
I require some help with my codes. The if query in the following codes does not work. Can anyone help me to identify where i went wrong?
THANKYOU!
$rthings = mysql_query(SELECT uid,itemid FROM inventory);
$things = mysql_fetch_assoc($rthings);
if ($_GET["operation"]==1){
$query = UPDATE Person SET wealth = wealth-5 WHERE uid = .$uid;
mysql_query($query) or die(mysql_error());
if ($things[uid]==$uid $$
|
HMVC Vs MVC with subdomains.
Ive been trying to run fopen() to open a txt file but no matter what I tried over the past hour I always get "Resource id #10" being displayed instead of the contents of the file...
Any ideas whats going on? What am I missing or doing wrong?
Its very basic code and Ive coded things similar before:
PHP Code:
$file = fopen(file.txt, r);
echo $file;
fclose($file);
But all I get is:
Resource
|
replacing cookie in http header
Hi,
The folloing code login to IMAP/POP3 box and retrieve its contents.
Attachements saved to a folder.
My problem is the following>
if more than 1 attachement exist,its name and content being used for the rest of them. So basically the first overwrite all the following.
Is the any idea whats wrong with this script?
<?php
chmod("/home/user1/public_html/hali/get/store/", 0777);
$login = user@domain.net;
$
|
Help on cURL POST to remote page with javascript
Hey, I cant figure out why this aint working...I am just trying to pass a php variable (string) into an onchange event...if i replace the variable with just a normal string, it works fine...
heres some code:
PHP Code:
$str = $node->getData(); //(this is the variable that doesnt work)
$toReturn = <div style=display:none; id=$nodeID>$space
<img src=images/plus.gif onclick=showHide($nodeChild); />
<l
|
emailing users on click
I use a conf.inc.php to define some Global variables since I roll out several copies of the same code over and over and need an easy place to edit some basic string variables.
My question is if someone knows how to reference a local variable (local to where the Global is called) in the Global variable.
simplified example of what works:
conf.inc.php file:
$GLOBALS[favcolor] = "My favorite color is %s.";
Some other php file
|
counting all values in column without creating a new column
Hi,
Ive set up a contact form on my website: www.labyrinths-studios.com but every time I submit the information from the email arrives as if the text fields are blank.
PHP Code:
<?php
/* Subject and email variables */
$emailSubject = Contact Form;
$webMaster = becky@labyrinth-studios.com;
/* Gathering data variables
|
[RESOLVED] djpeg does not output file
how do i copy a file from one folder to another??
i have tried using this:
Code:
$file=getpics.php;
$dest="archive/$id/";
if (!copy($file, $dest)) {
echo "failed to copy $file...
";
}
and i get this error
Code:
Warning: copy(archive/197/) [function.copy]: failed to open stream: Permission denied in
please help
|
Sorting Alpha and Numeric
Is it possible to run an already established crontab job via a PHP script? Basically, I want the job to be run as called without need for logging into Webmin.
Currently, Im running into issues with the script needing to run as root (which is how it is setup in the crontab), but my needing to run the script from the browser (apache). I thought of calling it in the script directly, but I didnt think I could chown from apache to root in the
|
[RESOLVED] Implode() going goofy or am I?
I am editing some old code from another programmer and keep getting data from $GLOBALS[argv].
I have no idea what this is and cant seem to find any info on it other than people are using it.
Can anyone tell me where this is set at or what causes a $GLOBALS[argv] variable to be set? Where should I look to find the source?
Thanks!
|
[RESOLVED] Got a problem with file_exists...
Im new to PHP and need help understanding what could possibly be the problem with my code. At first, Im just trying to send an email to myself to see that the email function works. But every time the mail() function returns FALSE and echos the failed message. I know the email address is good (Ive replaced my real email here with "myemail@gmail.com"). What can I do to debug this more? Or is there some kind of setup I need to do with
|
PHP Check If Word Exists, Then Echo Something Different
Hello,
So Im trying to have a checkbox removed on submit if its checked. This probably needs to be done with javascript, but I thought Id see what other people thought here first.
First, I have an xml file that is structured like so:
HTML Code:
<root>
<child1></child1>
<child2></child2>
<child3>
<item1></item1>
<item2></item2>
</child3>
</root>
|
Link Thumbnail
I have written a flex application that sends XML to a php script which will then be inserted into a databse.
The php script works fine when I am loading the XML from a static file but when I try and load the XML from the post variables it stops working.
I have written the post data to a text file and it is coming through.
My php file is as follows
PHP Code:
<?php
//Connect to the database
$link = mysql_conn
|
Display x records, then refresh and display the next set
HIi, all of you........
I have site in which i have put a link to download a database table in a excel format.
visit this link and download
http://genat.com/anesthesia/index.ph...d=54&Itemid=74
My script is working but when i download the file.
It displays the data in a single row
I want to display each record in a different row.
like this
1. NAME PLACE CITY
2. NAME PLACE CITY
3. NAME PLACE CITY
anybody pl
|
Ive just installed php5 on a new development machine. Apache and MySQL are working and a test of php with a simple phpinfo() works ok.
I have transferred my php4 code to the new machine (I didnt expect it to work straight away, but I also didnt expect this error:
Parse Error: syntax error, unexpected $end in C:wwwphpSitemodulesuser.php on line 128
It happens on each and every php file with the line number indicated not actually
|
Parse Error: syntax error
Hi everyone,
Throughout this website (and others), I have noticed people posting code in an absolute mess.
I have searched this site for a thread like this, and couldnt find one.
So therefore i have devised a quick example of good ways to space your code using tabs, in order to make it more readable.
I believe that people will get a much better response to their questions if they format their code to be more readable, like so:
|
PHP Syntax Formatting
Following are a few bookmarked links to the most common questions on this forum.
How to avoid PHP handling errors : generated by the functions, Why is the @ symbol used?, What is the difference between functionname() and @functionname().
Resizing Images
Pagination (alternative, alternative 2): Span pages like - Page 1, Page 2, Page 3, .... or 1-10, 11-20, 21-30, ...
Alternating Row Colors : How to have alternating row colors in a
|
Coding forum FAQ + Bookmarked threads
Salutations to the Forum,
Quote:
This thread is EXPERIMENTAL. The behaviour of this thread, the title of this thread, the contents of this thread, and this threads very existence may change without notice in future (in fact I hope it will. Except for the last bit. Cant edit something if its deleted).
The format is pretty simple. This thread contains links to other threads that discuss the pro
|
Collected solutions to common problems.
Has anyone seen a really awesome PHP project that can make a searchable archive of a mailing list? Ill be googling myself but was kind of hoping for an experienced opinion on the matter.
Ideally, the system would be a subscriber to the mailing list and when a new message is sent to the list then it would be immediately posted to a location on-line -- after being spam filtered of course.
|
Rubber Ducking --- this actually works
I dont know if Im wording this right.
I have a textarea that is entered into a database. When this is edited, I want to store and display a list of all the changes that have been made to it.
Like a conversation in a forum. The reason for this is that I want past changes to be locked from editing.
Would a new database table storing only this text fields data need to be created? Maybe have column for the work request number and a second c
|
I dont understand this ERROR message
One of my companys software vendors convinced me to let them develop a web service that would allow me to create records in our financial database. Their web service/commercial software is running on Server 2008. My web service client is running on Server 2008/XAMPP. At first their function worked fine, but now it always gives me fatal errors.
Heres my code:
PHP Code:
$ws = new SoapClient(http://local_server:8082/ws
|
OOP: style question for inheritance and constructors
Hello All,
I have have been using a a basic skicky php form at my site for a few months. You can view it here. I want to update the form with sticky drop down date selectors to make it more user friendly. I created a test version and uploaded it here. The test version works fine.
The problem is I got a parse error after updating the old form with the new code -- "Parse error: parse error in C:...
egistration_dropdown.php on line
|
Using PDO in another class
I am trying to make a function that would return all given days of a given month or a year. For instance I wanted to get all Mondays in a given month/year OR I wanted to get all Saturdays for a given month / year...
Function would be something like:
PHP Code:
function getDaysOfMonth($month, $year, $day_of_week) {
// $month = 1 - 12
// $year = 2010, etc
// $day_of_week = 1,2,3, etc (1 for Monday, 2 for Tuesday, 7 f
|
Looking for way to perform date(D)+1
Hi guys,
I need your help in creating a video with thumbnails. What I want is that, if I upload a video it will create automatically a thumbnail picture for it.
Im just new to php and I dont have any idea of this.
I really need your help about this.
Thank you in advance guys.
|
Multi-Dim Array Output Error
Hi all,
This is something related with php as well as java script. If anyone can help me regarding this issue i would be very pleased.
In a particular form, i have 2 fields namely customer id and Account type. Since there are many account types it is stored as a jump menu.
There are seperate tables in my database to represent each of those accounts types. There is a seperate field in each table called account number which is auto in
|