Someone please see what the problem is.. I have getting an error: Parse error: syntax error, unexpected T_VARIABLE, expecting '{' in /customers/test-dig.dk/test-dig.dk/httpd.www/database.inc.ph p on line 3 my php codes are: - <?
-
function connectDatabase()
-
$connect=mysql_connect("test_dig_dk", "test_dig_dk", "myusercode");
-
$select=mysql_select_db("ib",$connect);
-
if(!$connect || !$select)
-
{
-
?>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>Fehler beim Verbinden mit der Datenbank</title>
-
</head>
-
<body>
-
<p>Es ist beim Verbinden mit der Datenbank ein Fehler aufgetreten!</p>
-
</body>
-
</html>
-
<?
-
exit();
-
}
-
}
-
?>
-
10 2710 ak1dnar 1,584
Recognized Expert Top Contributor
Hi kilo,
Welcome to TSDN.
Mr.Php is expecting '{'
So put it there as he said. -
function connectDatabase()
-
{
-
I have some doubts with your script anyway. Are you trying to connect to mySQL DB?
Thanks,
-Ajaxrand
ak1dnar 1,584
Recognized Expert Top Contributor
This might usefull to you, for your next post. [code] tags
This time I made the job for you! :)
Thanks! -Ajaxrand pbmods 5,821
Recognized Expert Expert
Changed thread title to better describe the problem (did you know that threads whose titles contain phrases such as, 'please help' actually get FEWER responses?).
That did help.. { ??... Thank you very much.
Hi kilo,
Welcome to TSDN.
Mr.Php is expecting '{'
So put it there as he said. -
function connectDatabase()
-
{
-
I have some doubts with your script anyway. Are you trying to connect to mySQL DB?
Thanks,
-Ajaxrand
Hi ajaxrand. Yes?? I think so...
It's a program that I payed for, to help people to read and write Danish. the program should make the dictations and save it to a database, were people can
load them. The main frame of the php is database.inc.ph p were all php tools use to make a connections to DB to save and upload...
If you can make this happen that all my php's are working. I have no problem discuse your payment for your help.
ak1dnar 1,584
Recognized Expert Top Contributor
Hi ajaxrand. Yes?? I think so...
It's a program that I payed for, to help people to read and write Danish. the program should make the dictations and save it to a database, were people can
load them. The main frame of the php is database.inc.ph p were all php tools use to make a connections to DB to save and upload...
If you can make this happen that all my php's are working. I have no problem discuse your payment for your help.
Hi Kilo,
The Scripts Developer Network is a free forum and Community members are ready to help you Free of Charge.
If you paid for the softtware tool you have the rights to fix it up from themselves.
Any way your Problem is still unclear for me.What is not working part of your script.
Thanks :)
I having small proplems. I think. I've getting some errors 3 at all....
If we can take one at the time.
One of them are: Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource in /customers/test-dig.dk/test-dig.dk/httpd.www/ib/select_audio.ph p on line 27
The php code are: -
<?
-
require("database.inc.php");
-
{ connectDatabase();
-
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>Vælg lyd til <?=$_POST['title']?></title>
-
<link href="style.css" rel="stylesheet" type="text/css" />
-
</head>
-
-
<body>
-
<? if(file_exists("text/".$_POST['title'].".txt")) {
-
?>
-
<h1>Vælg lyd</h1>
-
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
-
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
-
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
-
<?
-
}
-
?>
-
<form enctype="multipart/form-data" action="save_dict.php" method="post">
-
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
-
<table border="0">
-
<?
-
$result=mysql_query("SELECT word FROM repository;");
-
while($entry=mysql_fetch_array($result)) {
-
$repository[]=$entry[0];
-
}
-
$word_start=0;
-
$word_stop=0;
-
$open=false;
-
$words=array();
-
$content=$_POST['content'];
-
for($i=0;$i<strlen($content);$i++) {
-
if(substr($content,$i,1)=="<" && !$open) {
-
$word_start=$i+1;
-
$open=true;
-
}
-
elseif(substr($content,$i,1)==">" && $open) {
-
$word_stop=$i;
-
$word=substr($content,$word_start,$word_stop-$word_start);
-
if(!in_array($word,$repository)) {
-
$words[]=$word;
-
?>
-
<tr>
-
<td><?=$word?></td>
-
<td><input type="file" name="<?=$word?>" /></td>
-
</tr>
-
<?
-
}
-
$open=false;
-
}
-
}
-
?>
-
</table>
-
<input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
-
<input type="hidden" name="content" value="<?=$_POST['content']?>" />
-
<input type="hidden" name="title" value="<?=$_POST['title']?>" />
-
<input type="submit" value="Upload & gem" />
-
</form>
-
</body>
-
</html>
[Please use CODE tags when posting source code. Thanks! --pbmods] pbmods 5,821
Recognized Expert Expert
kilo, use CODE tags around your code.
Review the REPLY GUIDELINES on the right next time you post.
Thanks!
MODERATOR
OK. I get it now
I have spoking to the company and it has been shout down. It's only one man sitting there.. what a shame..
I hope so much that you can help me through this..
Can you see what the following error mains:
Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL result resource in /customers/test-dig.dk/test-dig.dk/httpd.www/ib/select_audio.ph p on line 27
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /customers/test-dig.dk/test-dig.dk/httpd.www/ib/select_audio.ph p on line 43
PHP code: -
<?
-
require("database.inc.php");
-
connectDatabase();
-
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>Vælg lyd til <?=$_POST['title']?></title>
-
<link href="style.css" rel="stylesheet" type="text/css" />
-
</head>
-
-
<body>
-
<? if(file_exists("text/".$_POST['title'].".txt")) {
-
?>
-
<h1>Vælg lyd</h1>
-
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
-
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
-
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
-
<?
-
}
-
?>
-
<form enctype="multipart/form-data" action="save_dict.php" method="post">
-
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
-
<table border="0">
-
<?
-
$result=mysql_query("SELECT word FROM repository;");
-
while($entry=mysql_fetch_array($result)) {
-
$repository[]=$entry[0];
-
}
-
$word_start=0;
-
$word_stop=0;
-
$open=false;
-
$words=array();
-
$content=$_POST['content'];
-
for($i=0;$i<strlen($content);$i++) {
-
if(substr($content,$i,1)=="<" && !$open) {
-
$word_start=$i+1;
-
$open=true;
-
}
-
elseif(substr($content,$i,1)==">" && $open) {
-
$word_stop=$i;
-
$word=substr($content,$word_start,$word_stop-$word_start);
-
if(!in_array($word,$repository)) {
-
$words[]=$word;
-
?>
-
<tr>
-
<td><?=$word?></td>
-
<td><input type="file" name="<?=$word?>" /></td>
-
</tr>
-
<?
-
}
-
$open=false;
-
}
-
}
-
?>
-
</table>
-
<input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
-
<input type="hidden" name="content" value="<?=$_POST['content']?>" />
-
<input type="hidden" name="title" value="<?=$_POST['title']?>" />
-
<input type="submit" value="Upload & gem" />
-
</form>
-
</body>
-
</html>
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: mooneater |
last post by:
Hallo,
ich bin neu mit dem Umgang mit PHP,
und ich habe folgendes (siehe unten) programmiert.
Nun erhalte ich bei Aufruf meiner PHP-Datei folgende Fehlermeldung:
Parse error: parse error, unexpected T_VARIABLE in
C:\php5xampp-dev\htdocs\liteshop\liteshop.php
on line "wo 'var $username = $ls_user;' steht"
|
by: Ehartwig |
last post by:
I recently created a script for user verification, solved my emailing
issues, and then re-created the script in order to work well with the
new PHP 5 that I installed on my server. After submitting user
information into my creation script, I get the following error from the
page that is suppose to insert the user data into the database, create
a code, then send an email out for verification.
Parse error: parse error, unexpected $end in...
|
by: aamer |
last post by:
can anyone please help me, im getting a dumb:
Parse error: syntax error, unexpected T_VARIABLE in /home/jeddah/public_html/lomar/cart/remove.php on line 5
in the following file,
<?php require_once('../include/top.php');?>
<?
$urlpara_local="clickmenuid=$clickmenuid&smenuid=$smenuid&pageNum_product_rec=$pageNum_product_rec&totalRows_product_rec=$totalRows_product_rec&totrec=$totrec";...
|
by: Anna MZ |
last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website:
$sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')
VALUES ('$_POST', '$_POST', '$_POST')
mysql_query($sql)";
When I view the code in Internet Explorer I get the following error message:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or...
|
by: epots9 |
last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx
I get that message when i try to run my script, but if i disable an if statement (code below) then my code functions correctly...
if($specs == "DT")
{
$angle = $specs;
$rating = $specs;
if($angle == "00" || $angle == "30")
| |
by: crystal2005 |
last post by:
I found such eror message when i tried to test sending email.
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /www/110mb.com/h/e/a/v/e/n/t/u/heaventure/htdocs/send_contact.php on line 10
Do we have to set something on the hosting server in order to be able to send message??
This is my code that i encountered the problem
|
by: SilvaZodiac |
last post by:
Hi everyone,
I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the offending line, but being amateur, I don't know where. I've tried putting one in several places, to no avail. Clearly, to solve this in a smaller period than a week I need someone with more skill to help out. Heh heh.
The error is:
Parse error:...
|
by: praclarush |
last post by:
I've just started php, and this is a class assignment, but my question is I’m getting this error PHP Parse error: syntax error, unexpected T_IF, expecting T_VARIABLE or '$' in C:\wamp\www\ssp\SSP04\guessingGame.php on line 42. I’ve tried to make sense of it but I’m at a lose, there error is referring to this segment of the code.
else{
if(!isset($_GET)){
echo "<p>****</p>";
$guess = "****";
}//end if
//declaring some...
|
by: fburn |
last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux.
I receive an error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/inventoryControl/supplier.php on line 26 (line number changed to match code tags)
The code is as follows:
// get a supplier using the supplier id
|
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...
|
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...
| |
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
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...
| | |