cwarn23 387 Occupation: Genius Team Colleague Featured Poster

What does $returnCode actually contain?

$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
        switch($returnCode){
            case 404:
                $result = 'ERROR -> 404 Not Found';
                break;
            default:
                break;
        }

I would suggest replacing the above with the below if it just has a number.

$returnCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($returnCode==404 || $returnCode=='404'){
                $result = 'ERROR -> 404 Not Found';
        }
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i just need help in configuring the apache server and mysql

i have installed WAMP Server...
when i go to phpMyAdmin
i get this error :


Error
MySQL said:

#1045 - Access denied for user 'root'@'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

thanks..

Is the above quote that latest error as I have solved server problems with many windows servers using xampp. So I can understand your troubles. When you receive that error with phpmyadmin it normally means the password has changed. Happened to me once. Turned out Wikimedia changed the password so if you've installed any php scripts, then your password may have been changed to whatever you specified under the mysql section of the cms installation. So to fix this you will need to first find the mysql password you set in the cms installation. Then when you have that password, go to the folder phpmyadmin/config.inc.php then in that file change the following variable:

$cfg['Servers'][$i]['password'] = 'new_password_in_here';

If you haven't installed any php scripts then you may need to do a command line to reset the root password or if you installed a cms (content management system) but can't remember the password then tell me what your cms is and I'll download a copy …

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have just checked+tested your script and your for loop works perfectly. However the 2 breaks; in your switch command may be prevent the for loop from working. I would suggest finding an alternative to using the switch command.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Email sent

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Please give a detailed error message expaining when you get html vs plaintext mail, which emails it happens for, and please show me the contents of the email and email headers.

I have taken a screen shot of an email for a forum subscription and is attached to this post. (I blanked out personal details in black) It shows how instead of showing a styled email, there is all this html code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Two bugs that I have found. One is that the emails sometimes show the raw html code instead of displaying the styled content. Could this be possibly something to do with the email headers.

Also when viewing daniweb in the Opera browser, there is a minor bug with the bottom border. The bottom border is separated from the main page with a gray gap. However in Internet Explorer this isn't the case. I have attached a pic to help explain.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I would suggest first doing a defrage then a checkdisk and see what happens then. The defrage can be found on the Start menu. In xp is in Start -> All Programs -> Accessories -> System Tools -> Disk Defragmenter

Then checkdisk you will need to google for the appropriate command line.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In case you want to make a custom function, the following code will do the job but is really slow. But this will give you something to play with.

<?
function get_date($date,$timestamp=false) {
    if ($timestamp==false) {
        $timestamp=time();
        } else {
        $timestamp=round($timestamp);
        }
    if ($timestamp>=0) {
        return date($date,$timestamp);
        } else {
        if ($timestamp<-100000000)  { die('This timestamp will take too long to calculate'); }
        //calculate negative time
        $year=1970;
        for ($i=-1;$i>$timestamp;) { //year loop
            $year--;
            for ($k=31; $k>0;$k--) { //month loop (December)
                $month=12;
                $day=$k;
                for ($l=24; $l>0;$l--) {
                    $hour=$l;
                    for ($m=59; $m>-1;$m--) {
                        $minute=$m;
                        for ($n=59; $n>-1;$n--, $i--) {
                            $second=$n;
                            if ($i==$timestamp) { break;break;break;break;break; }
                            }
                        if ($i==$timestamp) { break;break;break;break; }
                        }
                    if ($i==$timestamp) { break;break;break; }
                    }
                if ($i==$timestamp) { break;break; }
                }
            if ($i==$timestamp) { break; }
            for ($k=30; $k>0;$k--) { //month loop (November)
                $month=11;
                $day=$k;
                for ($l=24; $l>0;$l--) {
                    $hour=$l;
                    for ($m=59; $m>-1;$m--) {
                        $minute=$m;
                        for ($n=59; $n>-1;$n--, $i--) {
                            $second=$n;
                            if ($i==$timestamp) { break;break;break;break;break; }
                            }
                        if ($i==$timestamp) { break;break;break;break; }
                        }
                    if ($i==$timestamp) { break;break;break; }
                    }
                if ($i==$timestamp) { break;break; }
                }
            if ($i==$timestamp) { break; }
            for ($k=31; $k>0;$k--) { //month loop (October)
                $month=10;
                $day=$k;
                for ($l=24; $l>0;$l--) {
                    $hour=$l;
                    for ($m=59; $m>-1;$m--) {
                        $minute=$m;
                        for ($n=59; $n>-1;$n--, $i--) {
                            $second=$n;
                            if ($i==$timestamp) { break;break;break;break;break; }
                            }
                        if ($i==$timestamp) { break;break;break;break; }
                        }
                    if ($i==$timestamp) { break;break;break; }
                    }
                if ($i==$timestamp) { break;break; }
                }
            if ($i==$timestamp) { break; }
            for ($k=30; $k>0;$k--) { //month loop (September)
                $month=9;
                $day=$k;
                for ($l=24; $l>0;$l--) {
                    $hour=$l;
                    for ($m=59; …
hbmarar commented: Thanks to cwarn for helping me +5
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have experimented with your problem and this appears to be a minor php bug. It seems to not handle negetive numbers properly. So to be able to do this job, you will need to make custom functions with loops that calculate the appropriate date. I will see what I can do as it won't be an easy task (due to leap years) but good luck.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well looks like you will need to have a separate file to refer to. To do this first create a new file with the following code:
image.php

<? //this is the entire page
echo file_get_contents('http://newpics.huntsvillecarscene.com/photos/random.mg?AlbumID=1626430&Size=Th&AlbumKey=eBBAU&rand=8075');
?>

Then make a html image take to that file like the following:
index.php

<?
echo '<img src="image.php">';
?>

But make sure those 2 files are in the same directory.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well file_get_contents() is the simplest solution and another solution is curl. However file_get_contents() only works if you place the http:// at the beginning of the address and the complete url. So for example try the following:

file_get_contents('http://newpics.huntsvillecarscene.co...BBAU&rand=8075');

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Linux/Unix Note:
After compiling the extension you will need to move the .so file to the extension directory then uncomment the extension from the php.ini file. After that you may restart apache then php should recognise the new modules/extensions. Just a thing I learn't when trying to get my extensions installed but never could get them to work anyways.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Now there is a thread on here about it, but it's over 3 years old so I assume in the last 3 years there has been better development in this area.

At last a newbie to the forums who didn't bump an old thread.:) As for the answer - xampp is a package you can use which is cross platform including mac. An installation copy with documentation can be found at http://www.apachefriends.org/en/xampp-macosx.html

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Perhaps there is an error in the mysql query with how the table structure is setup. Try the following and make sure the columns casing is correct.

include"../../pages/config.php";
$selectrow = mysql_query("SELECT * FROM members");
$remove1 = "Update AccLink SET autoRemove = autoRemove -1 WHERE Enable='true'";
mysql_query($remove1) or die('error1:<br>'.mysql_error());
$removeSQL = "DELETE FROM AccLink WHERE Enable='true' AND autoRemove <= 0";
$r = mysql_query($removeSQL) or die('error2:<br>'.mysql_error());
echo mysql_affected_rows($r).' rows were deleted.';

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want to do it where the enable column is true then try the following:

include"../../pages/config.php";
$selectrow = mysql_query("SELECT * FROM members");
$remove1 = "Update AccLink SET autoRemove = autoRemove -1 WHERE enable='true'";
mysql_query($remove1);
$removeSQL = "DELETE FROM AccLink WHERE enable='true' AND autoRemove <= 0";
$r = mysql_query($removeSQL);
echo mysql_affected_rows($r).' rows were deleted.';

or

include"../../pages/config.php";
$selectrow = mysql_query("SELECT * FROM members");
$remove1 = "Update AccLink SET autoRemove = autoRemove -1 WHERE Enable='true'";
mysql_query($remove1);
$removeSQL = "DELETE FROM AccLink WHERE Enable='true' AND autoRemove <= 0";
$r = mysql_query($removeSQL);
echo mysql_affected_rows($r).' rows were deleted.';
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I guess based on what kkeith29 said, your script would look more like the following:

include"../../pages/config.php";
$selectrow = mysql_query("SELECT * FROM members");
$remove1 = "Update AccLink SET autoRemove = autoRemove -1";
mysql_query($remove1);
$removeSQL = "DELETE FROM AccLink WHERE autoRemove <= 0";
$r = mysql_query($removeSQL);
echo mysql_affected_rows($r).' rows were deleted.';
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You had extra quotes in there. Try this:

include"../../pages/config.php";
$selectrow = mysql_query("SELECT * FROM members");
$query = mysql_fetch_array($selectrow, MYSQL_ASSOC);
//Run business removal
if ($query['Enable'] == "true"){
	if ($query['autoRemove']<=0){
	$removeSQL = "DELETE FROM AccLink WHERE autoRemove <= 0";
	mysql_query($removeSQL);
	echo "Business Removed. {$query['username']}<br>";
	}
	$remove1 = "Update AccLink SET autoRemove = autoRemove -1";
	mysql_query($remove1);
	echo "Run Sucessfull {$query['username']}<br>";
	}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

public function isIE()
    {
        $b = get_browser(null, true);
        
        if ($b['browser']=='IE')
            return true;
        else
            return false;
    }
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well as you pointed out (probably without realising it), the array values are not stored in the variable and instead the actual name/code of the array is stored in the variable of your first code box. So try making the sql variable the following:

$sql='SELECT * FROM TABLE WHERE TM_ID > 2000 AND TM_ID='.$row_tMain[TM_ID].' AND TM_DATE='.$row_tMain[TM_DATE];
//or the following two lines:
$filterString='AND TM_ID='.$row_tMain[TM_ID].' AND TM_DATE='.$row_tMain[TM_DATE];
$sql="SELECT * FROM TABLE WHERE TM_ID > 2000 ".$filterString;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have found that php itself can't stop the user from viewing the pages as the page is still loaded in the browsers cache. Only javascript can solve this cache problem. I managed to come up with the following just to let you know.

index.php

<?
echo '<html><head><SCRIPT LANGUAGE=javascript>
function linker() {
history.forward(); 
setTimeout("linker()",2048);
}
var hist=0;
function linkerb() {
if (hist==0) {
    linker();
    }
hist=1;
}
</SCRIPT>';
echo '<title>test</title></head><body onmousemove="javascript:linkerb();">';
?>
<a href="redirect.php?url=protectedexamplepage.php">Next page</a>

redirect.php

<?
if (isset($_GET['url']) && !empty($_GET['url'])) {
    setcookie('page',$_GET['url'],(time()+86407));
    header('Location: '.$_GET['url']);
    } else {
    echo '<h1>Page not found</h1>';
    }
?>

protectedexamplepage.php

<?
if (!isset($_COOKIE['page']) || substr_count($_SERVER['PHP_SELF'],$_COOKIE['page'])==0) {
    header('Location: redirect.php');
    }
echo '<html><head><SCRIPT LANGUAGE=javascript>
function linker() {
history.forward(); 
setTimeout("linker()",2048);
}
var hist=0;
function linkerb() {
if (hist==0) {
    linker();
    }
hist=1;
}
</SCRIPT>';
echo '<title>test</title></head><body onmousemove="javascript:linkerb();" bgcolor=#FFCCCC>';
?>
<a href="redirect.php?url=index.php">index</a>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i've tried your code still I can see the previous page in firefox.
do you have any idea on how to run session of every page then expire it in PHP?

thanks to your help.

It worked for me but you need to move the mouse after clicking back for the effect to take place and Javascript needs to be enabled. I will see what else I can make.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I managed to make a script that will prevent the user from going back to the page. On the pages you do not want to user to be able to go back to place the following script.

<head>
<SCRIPT LANGUAGE=javascript>
function linker() {
history.forward(); 
setTimeout("linker()",2048);
}
var hist=0;
function linkerb() {
if (hist==0) {
    linker();
    }
hist=1;
}
</SCRIPT>
</head>
<body onmousemove="javascript:linkerb();">

That will redirect the user a page forward as soon as the mouse moves over the page.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Been many years since I used this trick but I remember reading a javascript code where it stops the browser from recording the page in its history making it impossible to go back to unless linked to. I'll try searching for it again but that is one option if the code can be found.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

hey thanks! this works. :)

but would you mind? how'd i do this validation using php?

Well you would need the page to post to itself and php would check if everything is filled in. Also you would need a hidden field with the number of times that php for loop loops for. And if php finds that all the fields are filled in you would then use header redirect to process.php but I would say that javascript is the better solution as there is way less pressure on the server.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have added a javascript validation and the page is as follows:

<head><script>
function submitform() {
    var err;
    err=0;
    for (i=0; i<window.numrows;i++) {
        if (document.getElementById(i+"a").value == "") {
            document.getElementById('d'+i+'a').innerHTML="Fill this up.";
            err=1;
            } else {
            document.getElementById('d'+i+'a').innerHTML="";
            }
        if (document.getElementById(i+"b").value == "") {
            document.getElementById('d'+i+'b').innerHTML="Fill this up.";
            err=1;
            } else {
            document.getElementById('d'+i+'b').innerHTML="";
            }
        if (document.getElementById(i+"c").value == "") {
            document.getElementById('d'+i+'c').innerHTML="Fill this up.";
            err=1;
            } else {
            document.getElementById('d'+i+'c').innerHTML="";
            }
        if (document.getElementById(i+"d").value == "") {
            document.getElementById('d'+i+'d').innerHTML="Fill this up.";
            err=1;
            } else {
            document.getElementById('d'+i+'d').innerHTML="";
            }
        if (document.getElementById(i+"e").value == "") {
            document.getElementById('d'+i+'e').innerHTML="Fill this up.";
            err=1;
            } else {
            document.getElementById('d'+i+'e').innerHTML="";
            }
        }
    if (err==0) {
        document.mainvalidationform.submit();
        } else {
        alert("You need to fill in one or more fields");
        }
    }
</script></head><body>
<?php 

	if(!isset($_POST['noRec']) || (isset($_POST['noRec']) && empty($_POST['noRec'])) || isset($_POST['noRec']) && $_POST['noRec']<0)
	{ 	?>
    <form method="post" action="<?php $_SERVER['PHP_SELF'];?>">
        <span>How many employee do you want to add? </span>
        <input type="text" size="5" maxlength="2" name="noRec" /><br />
        <input type="submit" value="Add Record" />
    </form>
<?php }
	elseif(isset($_POST['noRec'])) { ?>
    	<form method="post" name="mainvalidationform" action="<?php if(empty($_POST['em'])) {$_SERVER['PHP_SELF']; } else { echo "process.php"; } ?>"> <?php
	for($i=0;$i<$_POST['noRec'];$i++) { echo "\n"; ?>
        	<table>
            	<tr>
                	<td class="left">Employee No:</td>
                	<td><input type="text" name="<?php echo "em[$i][emNo]"; ?>" value="<?php echo $i+1; ?>" size="3" maxlength="2" id="<?php echo $i;?>a" /></td>
					<td><div id="d<?php echo $i?>a"></div></td>
                </tr>
            	<tr>
                	<td class="left">First Name:</td>
                	<td><input type="text" name="<?php echo "em[$i][fName]"; ?>" <?php if( isset($_POST['em'][$i]['fName'])) { echo 'value="'.htmlentities($_POST['em'][$i]['fName']).'"'; } ?>  id="<?php echo $i;?>b" /></td>
                    <td><div id="d<?php echo $i?>b"></div></td>
                </tr>
            	<tr>
                	<td class="left">Last Name:</td>
                	<td><input type="text" name="<?php echo "em[$i][lName]"; ?>"  <?php if( isset($_POST['em'][$i]['lName'])) { echo 'value="'.htmlentities($_POST['em'][$i]['lName']).'"'; } ?>  id="<?php echo $i;?>c" /></td> …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

but how will i output those form fields? i dont know how. i tried to use print_r($_POST), it works. but i want to present the values like:

Employee NUmber: 1
FIrst name: Michael
Last name: gerona
etc: etc

??

Try adding this at the end of your code:

<?php
if (!empty($_POST)) {
for ($i=0;isset($_POST['em'][$i]);$i++) {
    echo '<hr>Employee Num: '.$_POST['em'][$i]['emNo'];
    echo '<br>First Name: '.$_POST['em'][$i]['fName'];
    echo '<br>Last Name: '.$_POST['em'][$i]['lName'];
    echo '<br>position: '.$_POST['em'][$i]['pos'];
    echo '<br>dept: '.$_POST['em'][$i]['dept'];
    }
    }
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Although I'm not sure how you want the surrounding data split, the data mentioned in post #1 would be matched like the following:

<?
$string = '"yZoomedDataMax":82060000,"time":"1980","sizeOption":"_UNISIZE","xLambda":1,"xZoomedDataMin":20273,"yZoomedDataMin":1353355,"stateVersion":3,"xAxisOption":"3","playDuration":15,"iconKeySettings":[{"trailStart":"1980","key":{"dim0":"Netherlands"}},{"trailStart":"1980","key":{"dim0":"Switzerland"}},{"trailStart":"1980","key":{"dim0":"Austria"}}],"yAxisOption":"4","yZoomedIn":false,"xZoomedIn":false,"orderedByY":false,"colorOption":"2"}';
//echo $string;
preg_match_all('/\{"([^"]+)":"([^"]+)","([^"]+)":\{"([^"]+)":"([^"]+)"\}\}/',$string,$array);
echo '<xmp>';
print_r($array);
echo '</xmp>';
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It would be better to expand it to two lines or a custom function like the following:

<?
function getarray($i) {
    $i=str_replace(array('(',')'),'',$i);
    return explode(',',$i);
    }
$input='(1980,Swizerland)';
$array=getarray($input);
echo '<xmp>';
print_r($array);
echo '</xmp>';
?>

I'm not sure if that is exactly what you want but matches what you have described.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

There are two possibilities to solve this problem. One is that if you are getting php to write a link with non alpha/numeric characters then simply use the urlencode() function. If however you are using a form with method=get and posts those characters into the url automatically then simply use the stripslashes() function on your $_GET tag. Below is an example of both cases:

<?
//example one
$id=urlencode('$@^*$@#%asdf23049582034985');
echo '<a href="index.php?id='.$id.'">test</a>';

//example two
$_GET['variable']=stripslashes($_GET['variable']);
echo $_GET['variable'];
?>

That will give you something to try and google about.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Would this be a solution?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="javascript" type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.jSuggest.1.0.js"></script>

<title>Simple English Online Dictionary</title>
<script type="text/javascript">

$(function($){

	$("#searchterm").jSuggest({
		minchar: 3,
 		zindex: 20000,
 		delay: 2500,
 		loadingImg: 'ajax-loader_green1.gif',
 		loadingText: 'Searching...',
 		autoChange: true,
		url: "suggestion.php?",
		type: "GET",
		data: "searchterm",

	});
})(jQuery);

</script>
</head>
<body>

<center>
	<p>You can search the meaning of word.</p>

	<div id="stylized">
		<form action="search.php" method="GET">
		<b>English Word :</b> 
		<input name="searchterm" type="text" id ="searchterm" />
		<input type=submit value="search">
		</form>
	</div>
<hr>
 <script type="text/javascript">
	$(document).ready(function()
		{
			$('a[rel="dbPopWin"]').click(
				function()
				{
					return $.dbPopWin( $(this).attr('href'), { dbPopWinWidth: 800, dbPopWinHeight: 600 } );
				}
			);
		}
	);
</script>

<?

$db_name="mydic";

trim($searchterm);

if (!$HTTP_GET_VARS["searchterm"])
{
echo "You haven't entered any word to search.Please, go back and entered it.";
exit;
}
$searchterm = addslashes($searchterm);
require("dict.php");
if (!$db)
{
echo "Error. Can't connect to database.Please try later";
}

mysql_select_db($db_name);
$query = "select * from words where engword like '".$HTTP_GET_VARS["searchterm"]."%' order by engword";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);


echo "<ul>";

for ($i=0; $i <$num_results; $i++)
while($data = mysql_fetch_array($result))

{     

echo "<li>{$data['engword']}</li>";
echo "<a href=\"http://localhost/dict/audio_en/{$data['engword']}.mp3\" title=\"open the audio file for the word {$data['engword']} \"rel='dbPopWin'><img src='audio.gif' alt = open the audio file for the word {$data['engword']} ></a>";

echo "  ";
echo (stripslashes($data["mword"])). "</li>";
echo " </br>";
echo " </br>";

}
echo "</ul>";

mysql_close($db);

echo "<br><br><a href='index.php'>search another word</a>";

?>
</body>
</html>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

but it is weird that echo "$cResult[3]" returns me only "132"

Perhaps it is an error in the part of the script that inserts into the table. Try using the mysql_real_escape_string() function to see if it escapes the spaces. And remember to put quotes around each string to be inserted. Below is an example:

echo '`column`="'.mysql_real_escape_string('132 main street').'"';
mysql_query('INSERT INTO `table` SET `column`="132 main street"') or die(mysql_error());

And check if the first line returns whats in the mysql query.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try replacing the problem area with the following:

$cResult=mysql_fetch_array(mysql_query($qry));
$fn=$cResult[0];
$ln=$cResult[1];
$email=$cResult[2];
$street=$cResult[3];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Thank you for all of the helpful responses.

If this topic is solved then please click the solved link to mark it solved but just to add my opinion, if you know c++ then you should be able to make php extensions that can do things which are presently impossible. One of the things I do know is impossible to currently do with php that I'm trying to make a php extension for is a video and audio library. But for some reason php doesn't like my dll's. Just a thing to keep in mind when you know both php and c++.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try something like this

mysql_query('INSERT INTO lesson (subject, year, learningArea, objectives, ability) VALUES ("'.mysql_real_escape_string($onrow["subject"]).'", "'.mysql_real_escape_string($onrow["year"]).'", "'.mysql_real_escape_string($onrow["learningArea"]).'", "'.mysql_real_escape_string($onrow["objectives"]).'", "'.mysql_real_escape_string($onrow["ability"]).'"') or die(mysql_error());

You may also want to post what was on the line before this as it too may also have an effect.

tulipputih commented: Thanks for your explanation +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Same folder as the script was placed.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Simply link to another page or same page where filesaving fails to pass if statement. Below is an example:

<?
if ($_GET['id']=='save') {
$links=array('http://www.example.com/',
'http://www.example.com/test.doc',
'http://www.mysite.com/file.xls',
'http://www.example.com/webpage.html');
foreach ($links AS $link) {
$webpage=file_get_contents($link);
file_put_contents('saved_'.basename($link),$webpage);
}
}
echo '<a href="index.php?id=save">Save files</a><br>';
if ($_GET['id']=='save') {
    echo '<a href="index.php"><b>Cancel Download</b></a>';
    }
?>

That should do the trick.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you mean multiple url's then the following will loop through an array to save each of those files:

<?
$links=array('http://www.example.com/',
'http://www.example.com/test.doc',
'http://www.mysite.com/file.xls',
'http://www.example.com/webpage.html');
foreach ($links AS $link) {
$webpage=file_get_contents($link);
file_put_contents('saved_'.basename($link),$webpage);
}
?>

Also, I haven't tested the above script for errors just to let you know.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To download just the single html file or store it in a variable then the following will do the trick:

<?
$webpage=file_get_contents('http://www.php.net/');
//now to save the variable to a html file
file_put_contents('index.html',$webpage);
?>

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

if i use "/uploads/" it says permission denied

That refers to the root when it begins with a slash. So try removing the slash at the beginning so it looks like "uploads/" just like in my sample code.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try making a path relative to your script like the following:

<?php
					
	if (move_uploaded_file($_FILES['userfile']['tmp_name'], "uploads/")) {
		print "Received {$_FILES['userfile']['name']} - its size is {$_FILES['userfile']['size']}";
	} else {
		print "Upload Failed";
	}
?>

Also you can try this altered version:

<?php
					
	if (move_uploaded_file($_FILES['userfile']['tmp_name'], "/home/alanhuno/public_html/dw/uploads/")) {
		print "Received {$_FILES['userfile']['name']} - its size is {$_FILES['userfile']['size']}";
	} else {
		print "Upload Failed";
	}
?>

Just note that there needs to be a slash at the end of the path.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Don't forget Ajax which is like javascript cross php. It allows client side to server side interaction.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The order I need is by Priority. I need it like this:

Leader
Singer
Piano
Synth
A-Guitar
E-Guitar
...

Won't that ONLY get it in ASC order for each column. See the last part of my post. It has a order or Priority.

Now I get ya. I don't think that is possible to do in mysql alone. You would need to convert the results into a giant array then sort the array into the order as pointed out in the above quotes. Then it would be possible to loop through the array results in order.

Or if that requires too much memory, you could use WHERE Instrument="Leader" and loop through those results and do the same for each type. Thats how I would do it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try this:

<?php
$query = "select * FROM Ev_AvVolunteers  where id_Event='$id_Event' ORDER BY `Name`, `Instrument`";
$results = mysql_query($query) or die("Error performing query"); 
?>

or

<?php
$query = "select * FROM Ev_AvVolunteers  where id_Event='$id_Event' ORDER BY `Instrument`, `Name`";
$results = mysql_query($query) or die("Error performing query"); 
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The type of quotes you used are invalid. I've never seen double italic quotes like that before but the following should do the job.

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
//before was: echo “This is a PHP line”;
echo "This is a PHP line"; //now is
phpinfo();
?>
</body></html>

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It's just the php.ini settings. Place the following code at the top of each file with that error.

<?
error_reporting(E_ALL ^ E_NOTICE);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

One of the first php scripts I downloaded was a php voting poll called apoll. It can be downloaded through this page. Also it's been in beta for years so don't expect an upgrade. Hope it helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If your trying to place html code inside a textarea box then you will need to use Java (not Javascript). This is because it is impossible for html/javascript/css to display the links in the textarea as found in a google search however I have seen examples of it being done in Java though. That is why on every forum you see bbcode instead of dynamically formated text in the textarea field.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Wierd those mysqli functions. Try converting your code to the mysql equivilents such as the following:

mysql_connect("localhost", "user", "pass") or
die("<p>Unable to connect to the database server</p>" . "<p>Error code ".mysql_error());
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If it is uploadphotos.php that the script is in and you want the photos to be in Gallery/photos then I think it would be one of the following:

../../Gallery/photos/
../../../Gallery/photos/

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Then could you specify with html code in a code box what you would like the output to be?
I will guess what you want again. The following will just an underlined piece of text without a link.

<?php
for ($i =0; $i < $ValuenumtableChildren; $i++)
{
echo '<u>'.$Valuechild[$i].'</u><br>'."\n";
}
?>

and the following will do the same without the underline:

<?php
for ($i =0; $i < $ValuenumtableChildren; $i++)
{
echo $Valuechild[$i]."\n";
}
?>

Updated the code