cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and I have been searching for a ssh program with a graphical interface purely to upload and download files from the root of the server without ftp. Does anybody suggest any programs for this job?
Windows XP Pro is my Operating System and Ubuntu versions are also welcome.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

well, it's one of my first projects (non professional of course).
So keeping it easy would be nice :-).
It's only for a website with few visitors so I don't think that will be the problem.

Didn't realise it was one of your firsts projects because you've made so many posts on daniweb. But yea. Maybe after the first year of programming you then might want to learn the best cpu techniques. Until then keeping it easy would be the main thing as some languages can be scary to learn.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Does it really slow down performance so much to call a function from another class than to write the full code each time it is needed.
That seems weird to me, then OO programming would be kind of a stupid thing to do, right?

Well the reason why OO or OOP programming is believed to be faster is because the user is giving the computer instructions in the same way that the computer thinks. And example with english is say you were given a piece of paper written in chinese and a piece of paper written in german. It would be easier for you to understand the german paper because it is closer to your language. However I am not sure if the same applies for languages where there is a compiler instead of an interpreter.

As for why it would be slower, it is because the computer is doing things that the user would normally do such as escape strings and even find where to escape the strings since an AI (Artificial Intellegence) to some degree would be needed. So the cpu effects may be minor on a small scale but if you receive a few thousand visitors a week then you would notice the difference. So generally best practice it for to use the dll's but if you messing around or aren't worried about cpu then external classes can be used for sure.

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

Perhaps php short tags might make a difference. Below is an example and I fixed a mysql bug at the same time.

<? session_start();
require_once('l2t_connect.php');
if($_GET['action'] == "send")
{
if(isset($_REQUEST['btnSend']))
{
$key=substr($_SESSION['key'],0,5);
$number = $_REQUEST['number'];
if($number!=$key)
{
$message = "Please enter the correct Code!";
}
else
{
$sqlAdd="INSERT INTO l2t_enquiry (name, email, conno, comment, is_answered, is_deleted) VALUES ( '".
mysql_real_escape_string($_POST['enq_name'])."', '".mysql_real_escape_string($_POST['emailid']).
"', '".mysql_real_escape_string($_POST['conno'])."', '".mysql_real_escape_string($_POST['comments']).
"', 'true', 'true')";
$resultAdd = mysql_query($sqlAdd);
}
}
}
?>

If that doesn't work then make sure there are no spaces/tabs before the <? as that will also cause an error. Also please use code tags like I have above as it make the code so much more readable.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you don't mind the extra recourses being drained by the interface finding where to convert things then first I would suggest a google search. I tried googling and one of the first results was php mysql wrapper. Generally I prefer not to use an interface to increase speed but I suppose if you find php hard then that might be the way to go. Good luck with the google search.

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

Why not just try it and find out. That's one of the great things with having xampp or wamp/lamp. Because you can easily test it under a localhost environment with that software and I can tell you now, testing that won't crash a your computer unlike calculating pi to 1,000,000 digits using the bcmath library.

peter_budo commented: Good advice ;) +22
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

That last line would have been a real bug. Try the following:

<?php session_start();
require_once('l2t_connect.php');
if($_GET['action'] == "send")
{
if(isset($_REQUEST['btnSend']))
    {
    $key=substr($_SESSION['key'],0,5);
    $number = $_REQUEST['number'];
    if($number!=$key)
        {
        $message = "Please enter the correct Code!";
        }
    }
}

Also make sure l2t_connect.php does not contain session_start(). Good luck.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I wouldn't suggest downloading external classes when there are two libraries already built in for mysql. One of them is oop and the other function based. The mysql class which is in oop is actually called mysqli while the other is just called mysql. Check those two links as they link to the official documentation for those libraries and should already be installed. Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you mean for the bot to stick to one domain I believe the above script does that and as for how. It is fairly simple. First you get the domain of the site entered then the domain of the url scanning and if they match it will add that page to the array loop interface. Always wanted to use that term. So below is an example of what is happening in the above script to stick to the one domain.

function domain ($ddomain) {
return preg_replace('/^((http(s)?:\/\/)?([^\/]+))(.*)/','$1',$ddomain);
}
$site='http://www.google.com/test/';
$link_inside_homepage='http://www.google.com/image.png';
if (domain($site)==domain($link_inside_homepage)) {
//then checks if the file file extension is in the array list
    //if that passes the link is added into the loop interface
    //where it will be processed.
}

Hope that helps you understand as the script in the code in the first post already has the requested functionality embeded.

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

I have been pm about this question from Crohole so many times that I thought I would setup a topic where others can join in. Crohole has asked about setting up a bot like I have many times but his questions seem to be looping back to the beginning. So I'll explain briefly what to do for making a bot and if Crohole has any more problems he could post here instead of sending lots of pm's to me. So first the basic script that I have setup for a bot is as follows:

<form method="post">Scan site: <input type="text" name="site" value="http://" style="width:300px">
<input value="Scan" type="submit"></form>
<?
set_time_limit (0);

if (!function_exists('stripos')) {
  function stripos($str,$needle,$offset=0) {
      return strpos(strtolower($str),strtolower($needle),$offset);
  }
}

if (isset($_POST['site']) && !empty($_POST['site'])) {
/* Formats Allowed */
$formats=array('html'=>true,'htm'=>true,'xhtml'=>true,'xml'=>true,'mhtml'=>true,'xht'=>true,
'mht'=>true,'asp'=>true,'aspx'=>true,'adp'=>true,'bml'=>true,'cfm'=>true,'cgi'=>true,
'ihtml'=>true,'jsp'=>true,'las'=>true,'lasso'=>true,'lassoapp'=>true,'pl'=>true,'php'=>true,
'php1'=>true,'php2'=>true,'php3'=>true,'php4'=>true,'php5'=>true,'php6'=>true,'phtml'=>true,
'shtml'=>true,'search'=>true,'query'=>true,'forum'=>true,'blog'=>true,'1'=>true,'2'=>true,
'3'=>true,'4'=>true,'5'=>true,'6'=>true,'7'=>true,'8'=>true,'9'=>true,'10'=>true,'11'=>true,
'12'=>true,'13'=>true,'14'=>true,'15'=>true,'16'=>true,'17'=>true,'18'=>true,'19'=>true,
'20'=>true,'01'=>true,'02'=>true,'03'=>true,'04'=>true,'05'=>true,'06'=>true,'07'=>true,
'08'=>true,'09'=>true,'go'=>true,'page'=>true,'file'=>true);

function domain ($ddomain) {
return preg_replace('/^((http(s)?:\/\/)?([^\/]+))(.*)/','$1',$ddomain);
}

function url_exists($durl)
		{
		// Version 4.x supported
		$handle   = curl_init($durl);
		if (false === $handle)
			{
			return false;
			}
		curl_setopt($handle, CURLOPT_HEADER, true);
		curl_setopt($handle, CURLOPT_FAILONERROR, true);  // this works
		curl_setopt($handle, CURLOPT_HTTPHEADER, 
Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") );
		curl_setopt($handle, CURLOPT_NOBODY, true);
		curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
		$connectable = curl_exec($handle);
		curl_close($handle);  
        if (stripos(substr_replace($connectable,'',30),'200 OK')) {
            return true;
            } else {
            return false;
            }
		}
 $fdata='';
//below function will only get links within own domain and not links outside the site.
function getlinks($generateurlf) {
    global $formats;
    global $f_data;
    $f_data=file_get_contents($generateurlf);
    $datac=$f_data;
    preg_match_all('/(href|src)\=(\"|\')([^\"\'\>]+)/i',$datac,$media);
    unset($datac);
    $datac=$media[3];
    unset($media);
    $datab=array();
    $str_start=array('http'=>true,'www.'=>true);
    foreach($datac AS $dfile) {
        $generateurle=$generateurlf;
		$format=strtolower(preg_replace('/(.*)[.]([^.\?]+)(\?(.*))?/','$2',basename($generateurle.$dfile)));
        if (!isset($str_start[substr_replace($dfile,'',4)])) {
            if (substr_replace($generateurle,'',0, -1)!=='/') …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I've been seaching and googling for an answer that I just can't find. I have a vps account with no nameserver and have been told I need to make the nameserver myself. Does anybody know of any good tutorials or could explain how to setup the nameservers. I have already added all of my ip addresses to my account cpanel/whm but am struggling with this nameserver problem. I have tried going to the "basic cpanel/whm setup" panel then click assign ip address but that just leads me to a screen with a loading bar which stays there for at least hours and had to cancel it since it seemed like an infinit loop.
So please, can anybody guide me to how to setup a nameserver without registering or paying for a new domain.

Control panel: cpanel/whm
Operating System: CentOS

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

Well the only comment I have is that you could do a better database design if I'm reading that code correctly. Also, what is your database design as in what columns are in what table(s)? Although I would design it with only one loop, as pointed out in your code, str_replace is the way to go.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try using sessions or cookies so php can remember weather the uploader has been processed.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I had the same problem with xampp and means that your mail server is not turned on or not configured. It's a nightmare getting it running as I have tried and failed. But it is possible to set the php.ini to not make to mail() function just not do anything at all - in other words, if you configure the php.ini file right then no emails will be sent and there will be no error message even with all error messages enabled. But I assume that you want the mail() function to work so if this is purely for localhost then I would suggest try looking into alternative pear libraries etc. Or if your very lucky you might be able to even get the mail server running on your computer which comes with xampp. Hope that breif explination helps.

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

Maybe php doesn't have the permissions to access the base of the home folder where as when you do it through the command terminal you are logged in as administrator. So try something like the following but replace the end address with the address to your web directory.

echo exec('youtube-dl http://www.youtube.com/watch?v=ZMhMZ8Ciyxw -o /home/user/public_html/video.flv');

So the public_html folder is the base of your website.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is because the second last parameter in the imagettftext() function needs to be the path to your font file. You can't just use the name of font's as by default the system has only 1 font. So go into your windows folder to find the font files then upload them and specify the path. Also I saw in your code you didn't use quotes on the following line which could cause an error.

$fname = arial;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

When using functions, try making them all lower case. So don't use capitals for the function name. Below is an example of what 2 lines should look like

header('Content-type: image/png');
imagepng($im);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I read that making the following the code can sometimes work...

exec('youtube-dl http://www.youtube.com/watch?v=ZMhMZ8Ciyxw -o /home/video.flv');
exec('exit(0)');

Also I read that there is some setting in the php.ini file for the exec function but I can't seem to find it.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you own a VPS (Virtual Private Server) like I do and really want to use those functions then you will need to find the security policies for php and set the security policies to allow php to interact with the core system. I think it's mainly a thing that's not enabled by default due to security reasons but I myself am not sure on how to enable these security policies. I'll google a bit for you to see if I can find such info.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The error is simple and clear. The image path specified in the imagecreatefrompng() function does not exist. So just check that your files are in the right locations as they probably are not or that you may have specified the wrong location in the function.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Just to let you know I find it is best to not use the system command line functions. My reason - I find that some servers just aren't compatible with these functions due to security policies and can even crash a server if the right settings are set on the server. So perhaps if you explain what you are trying to make the command do (like copying a movie) and I will try and find an alternative. I know the file_get_contents() and file_put_contents() are good for copying files on other servers.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try logging in as admin and click on the side Administer->Site building->Menus->Navigation and make sure everything is ticked and be sure to click the save button at the bottom when changing settings. Other than that I would suggest reinstalling drupal be replace the newly created database with your current database. But be sure to have backups of everything first. Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

i already tried basically copied his .ini file but still nothing.

I specifically said in that post not to copy that file but to delete things in your file so it is left with what is shown in my file otherwise you will for sure have errors. So in other words you delete everything after the list of extensions including the list of extensions. But make sure you have a backup first.

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

When i ran the command it says: PHP Parse Error: parse error in Command line code on line 1. Also while i dont the exact name of hte process for php i dont see anything indicating php is running

If php isn't running in the background it means there is a fatal error in the main php.ini file. As a test, first copy your php.ini file then in the original disable all the dll files so php has no extensions. Then delete the individual dll configurations in the original and see if that works. You may also post your php.ini file so I can show what I mean. This will determine if it is an invalid extension simply by checking weather the background processor is there or not after all extensions are disabled. Below is an example of what my php.ini would look like with all extensions disabled but only use the below as a guide to altering yours as they may not match.

;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes, and *NOT* for production purposes.
; For several security-oriented considerations that should be taken
; before going online with your site, please consult php.ini-recommended
; and http://php.net/manual/en/security.php.


;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; This file controls many aspects of PHP's behavior.  In order for PHP to
; read it, it must …
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

For your first question about ip addresses, php can only detect the ip address which is sent from the isp (internet service provider). So if for example a proxy server is setup then only the last link in the ip address chain before reaching your isp will be recorded and readable by php. So the variable/array for getting the ip address from as far traced back as possible is the following:

<?
echo $_SERVER['REMOTE_ADDR'];
?>

As for your second question, if your trying to make fake domains under a localhost environment then I would suggest to look at the apache virtual host configuration.

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

They must have really tightened their filters so I'm guessing the following might work:

$from="From:mysite@mysite.com\r\n";
$to=$email;
//do not put .com or any other tld after sitename as it is just the name.
$subject="Profile comment on Sitename";
$content="User replied: $user
A user has given you a new comment on your profile.
To view the comment go to the below url.
http://www.mysite.com";

if($content){
mail($to, $subject, $content,$from);

Other than that the only thing I can think of is wording it so it has a fake unsubscribe link for the email bots to read.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I ran the command and nothing came up. Also yes i am typing the localhost address in my address bar not the path of the file. And yes i installed apache before i installed php

Opps, silly me placing a bug in that one line of php code. There should be no underline in php_info(); and instead be phpinfo();
Also make sure the path on the left side of the command is the path to your php console/exe file. So try the following if you have installed php in C:\php\

c:\php\php.exe -r 'phpinfo();'

And what to do with that code, place it in the windows command terminal located at start->run->type: cmd ->press enter -> type code described above -> press enter. It should list the data in phpinfo() function to check your configurations.

Also I would suggest to do ctrl+alt+delete to see if php is actually running in the background. But would do a reboot first so results aren't misleading. If the php service is not running in the background then it is likely to be a broken dll (eg. corrupted or incompatible).

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

If php works from the command console but not through the browser then I would say that php is not communicating with the webserver/apache or the php web service has not started up. You might want to check with the command console the command c:\php\php.exe -r 'php_info();' At the top of its output will be hidden errors that may stop the php service from launching. Also, be sure to install apache before php otherwise there might be some configuration problems. And if your using windows, the easiest way the get a web environment setup is by using xampp.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

A classic example of spam classification. I would suggest try using the following code.

$from="From:mysite@mysite.com\r\n";
$to=$email;
$subject="$user left you a Profile Comment";
$content=" $user has given you a new comment on your profile at mysite.Com
to view the comment click http://www.mysite.com";

if($content){
mail($to, $subject, $content,$from);

Why is it classified as spam? Well from what I can tell having a website in the subject would bump up the ranking and possibly making the content almost identical to the title. Also make sure the email from header is not from hotmail or yahoo as that will for sure bump up the ranking if sending to hotmail from hotmail for example. Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sorry I haven't been tuned in for the past couple cro of days since i've just switched from windows to linux but you might like this link: http://syntax.cwarn23.info/PHP:_Making_a_search_engine. Also there is an update to my previous code which is as follows:

<form method="post">Scan site: <input type="text" name="site" value="http://" style="width:300px">
<input value="Scan" type="submit"></form>
<?
set_time_limit (0);
if (isset($_POST['site']) && !empty($_POST['site'])) {
/* Formats Allowed */
$formats=array('html'=>true,'htm'=>true,'xhtml'=>true,'xml'=>true,'mhtml'=>true,'xht'=>true,
'mht'=>true,'asp'=>true,'aspx'=>true,'adp'=>true,'bml'=>true,'cfm'=>true,'cgi'=>true,
'ihtml'=>true,'jsp'=>true,'las'=>true,'lasso'=>true,'lassoapp'=>true,'pl'=>true,'php'=>true,
'php1'=>true,'php2'=>true,'php3'=>true,'php4'=>true,'php5'=>true,'php6'=>true,'phtml'=>true,
'shtml'=>true,'search'=>true,'query'=>true,'forum'=>true,'blog'=>true,'1'=>true,'2'=>true,
'3'=>true,'4'=>true,'5'=>true,'6'=>true,'7'=>true,'8'=>true,'9'=>true,'10'=>true,'11'=>true,
'12'=>true,'13'=>true,'14'=>true,'15'=>true,'16'=>true,'17'=>true,'18'=>true,'19'=>true,
'20'=>true,'01'=>true,'02'=>true,'03'=>true,'04'=>true,'05'=>true,'06'=>true,'07'=>true,
'08'=>true,'09'=>true,'go'=>true,'page'=>true,'file'=>true);

function domain ($ddomain) {
return preg_replace('/^((http(s)?:\/\/)?([^\/]+))(.*)/','$1',$ddomain);
}

function url_exists($durl)
		{
		// Version 4.x supported
		$handle   = curl_init($durl);
		if (false === $handle)
			{
			return false;
			}
		curl_setopt($handle, CURLOPT_HEADER, true);
		curl_setopt($handle, CURLOPT_FAILONERROR, true);  // this works
		curl_setopt($handle, CURLOPT_HTTPHEADER, 
Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") );
		curl_setopt($handle, CURLOPT_NOBODY, true);
		curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
		$connectable = curl_exec($handle);
		curl_close($handle);  
        if (stripos(substr_replace($connectable,'',30),'200 OK')) {
            return true;
            } else {
            return false;
            }
		}
 $fdata='';
//below function will only get links within own domain and not links outside the site.
function getlinks($generateurlf) {
    global $formats;
    global $f_data;
    $f_data=file_get_contents($generateurlf);
    $datac=$f_data;
    preg_match_all('/(href|src)\=(\"|\')([^\"\'\>]+)/i',$datac,$media);
    unset($datac);
    $datac=$media[3];
    unset($media);
    $datab=array();
    $str_start=array('http'=>true,'www.'=>true);
    foreach($datac AS $dfile) {
        $generateurle=$generateurlf;
		$format=strtolower(preg_replace('/(.*)[.]([^.\?]+)(\?(.*))?/','$2',basename($generateurle.$dfile)));
        if (!isset($str_start[substr_replace($dfile,'',4)])) {
            if (substr_replace($generateurle,'',0, -1)!=='/') {
                $generateurle=preg_replace('/(.*)\/[^\/]+/is', "$1", $generateurle);
                } else {
                $generateurle=substr_replace($generateurle,'',-1);
                }
 
            if (substr_replace($dfile,'',1)=='/') {
                if (domain($generateurle)==domain($generateurle.$dfile)) {
                    if (isset($formats[$format]) 
                        || substr($generateurle.$dfile,-1)=='/' || substr_count(basename($generateurle.$dfile),'.')==0) {
                        $datab[]=$generateurle.$dfile;
                        }
                    }
                } else if (substr($dfile,0,2)=='./') {
                $dfile=substr($dfile,2);
                if (isset($formats[$format])) {$datab[]=$generateurle.'/'.$dfile;}
                } else if (substr_replace($dfile,'',1)=='.') {
                while (preg_match('/\.\.\/(.*)/i', $dfile)) {
                $dfile=substr_replace($dfile,'',0,3);
                $generateurle=preg_replace('/(.*)\/[^\/]+/i', "$1", $generateurle);
                }
                if (domain($generateurle)==domain($generateurle.'/'.$dfile)) {
                    if (isset($formats[$format]) || substr($generateurle.'/'.$dfile,-1)=='/' 
                        || substr_count(basename($generateurle.'/'.$dfile),'.')==0) {
                        $datab[]=$generateurle.'/'.$dfile;
                        }
                    } …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

It is a simple setting in your C:\xampp\apache\conf\httpd.conf file. So first copy the file at that location for a backup. Then load the file at C:\xampp\apache\conf\httpd.conf in notpad to do the following modifications.
1 - Uncomment the following line by removing the # symbol

#LoadModule rewrite_module modules/mod_rewrite.so

change above to below

LoadModule rewrite_module modules/mod_rewrite.so

Then replace all instances of AllowOverride None to AllowOverride All

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

Try replacing the retrieve_cats function with the following:

function retrieve_cats($cat)
{ global $scl;
	while ($row_sub_cat_list = mysql_fetch_assoc($scl))
	{  
	echo $row_sub_cat_list['name'].'<br />';
	}
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

The error report makes it so much easier. You can ignore most of what I said on my previous post as according to the error message it is the following two lines.

$old_x=imageSX($save);
            $old_y=imageSY($save);

if for example the save image is a jpeg then replace with the following.

$resource=imagecreatefromjpeg($save);
$old_x=imageSX($resource);
            $old_y=imageSY($resource);
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
$thumb -> saveImage($thumbpath0,"115","120");

If your refering to the above line being the error line then it would be because you need to specify $recourse in the first parameter and not $path. So try looking up functions like createimagefromgif() for the first parameter input. Basically functions like createimagefromjpeg() load a file into the php file system where it can be used via variables.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have managed to program an algorithm which places capitals at the start of sentences, keeps only the useful information and places code in a <pre> css code box. My last problem (I hope) is the rss feeds in most forums that I've checked seem to be almost live and contain links to threads with only one or two posts. The only solution I can think of is for a small script to every hour or so to retrieve the links in the rss feeds which can be stored in a database to be followed a week later. Does anybody know a better way around this problem or isn't there one?