Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Posts posted by TavoxPeru


  1. Those are MySQL's functions. I wrote the web software myself. It was working on my machine and on hosting server that provides MySQL version higher than 4.1.1. As also mentioned in MySQL reference manual, those function are only introduce after 4.1.1

    Well, a few months ago i need the same functions exactly for the same reasons as you and lucky me i found this php code but i dont remember where i found it :P so i hope it helps you.

    <?phpfunction datediff($interval, $datefrom, $dateto, $using_timestamps = false) {	/*	$interval can be:	yyyy - Number of full years	q - Number of full quarters	m - Number of full months	y - Difference between day numbers	(eg 1st Jan 2004 is "1", the first day. 2nd Feb 2003 is "33". The datediff is "-32".)	d - Number of full days	w - Number of full weekdays	ww - Number of full weeks	h - Number of full hours	n - Number of full minutes	s - Number of full seconds (default)	*/	if (!$using_timestamps) {		$datefrom = strtotime($datefrom, 0);		$dateto = strtotime($dateto, 0);	}	$difference = $dateto - $datefrom; // Difference in seconds	switch($interval) {		case 'yyyy': // Number of full years			$years_difference = floor($difference / 31536000);			if (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom), date("j", $datefrom), date("Y", $datefrom)+$years_difference) > $dateto) {				$years_difference--;			}			if (mktime(date("H", $dateto), date("i", $dateto), date("s", $dateto), date("n", $dateto), date("j", $dateto), date("Y", $dateto)-($years_difference+1)) > $datefrom) {				$years_difference++;			}			$datediff = $years_difference;			break;		case "q": // Number of full quarters			$quarters_difference = floor($difference / 8035200);			while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($quarters_difference*3), date("j", $dateto), date("Y", $datefrom)) < $dateto) {				$months_difference++;			}			$quarters_difference--;			$datediff = $quarters_difference;			break;		case "m": // Number of full months			$months_difference = floor($difference / 2678400);			while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($months_difference), date("j", $dateto), date("Y", $datefrom)) < $dateto) {				$months_difference++;			}			$months_difference--;			$datediff = $months_difference;			break;		case 'y': // Difference between day numbers			$datediff = date("z", $dateto) - date("z", $datefrom);			break;		case "d": // Number of full days			$datediff = floor($difference / 86400);			break;		case "w": // Number of full weekdays			$days_difference = floor($difference / 86400);			$weeks_difference = floor($days_difference / 7); // Complete weeks			$first_day = date("w", $datefrom);			$days_remainder = floor($days_difference % 7);			$odd_days = $first_day + $days_remainder; // Do we have a Saturday or Sunday in the remainder?			if ($odd_days > 7) { // Sunday				$days_remainder--;			}			if ($odd_days > 6) { // Saturday				$days_remainder--;			}			$datediff = ($weeks_difference * 5) + $days_remainder;			break;		case "ww": // Number of full weeks			$datediff = floor($difference / 604800);			break;		case "h": // Number of full hours			$datediff = floor($difference / 3600);			break;		case "n": // Number of full minutes			$datediff = floor($difference / 60);			break;		default: // Number of full seconds (default)			$datediff = $difference;			break;	}	return $datediff;}//echo datediff('d','9/7/2006','12/7/2006') //this will return the interval of day between the 2 days?>
    Best regards,

  2. Hi,
    A few question here,

    1. Just wondering, the MySQL hosted on Xisto.com is actually version "4.0.26-Max" according to phpmyadmin. But why is cPanel showing "4.1.21-standard"?

    2. Actually i've existing codes that need function introduced after version 4.1.1, is there by any chance Xisto or xisto is going to upgrade the MySQL package?

    Thanks

    Hi,

    In my case cPanel shows that i have MySql version 4.0.27-standard but according to phpMyAdmin i have 4.0.26-Max, its very strange, may be an admin can tell us why exists this differences.

    Best regards,

  3. I put together this:

    //Make Sure $qty is NOT blank before checking if it is a number	if (!empty($item_1_qty)) {//not empty			}	if (intval($item_1_qty) !== $item_1_qty){			//item 1 qty is not a whole number			$redirect_to = 'order_form.php?error=6';				header("Location: $redirect_to");			exit();		}

    But I get my error message coming no matter whether it is an integer or not.
    If your variable is coming from a form i reccomend you to cast it before you use it, its simple:
    $item_1_qty = (int) $_POST['item_1_qty'];
    Also take a look to the is_numeric() php function, because it is recommended to use it with variables that are submited by a form.

    Best regards,

  4. Hi, phpSitemapNG is a free php script that creates sitemaps that can be used with the google webmaster tools, it is very powerful and easy to setup and use, and if you have a google acount it also can submit your new sitemap created to google.

    It can be downloaded from http://enarion.net/tools/phpsitemapng/

    I dont know if this is the correct place to post, so, admins, please relocate it to the correct place.

    Best regards,


  5. ....The other addon domain is HANDYPHP.COM which is my new website and is doing pretty well these days. It is a PHP helpsite and snippet repository. Much of the site is still in developement but to artificially stimulate the website, I have released a couple of extensions for Joomla which seem to be pretty popular. I wrote the first one for my website and decided to distribute it publicly. The second one isn't for my website but is similar in nature to the first and fills a larger need than the first one. I may develope a few more since they drive so much traffic to my site.

    The plan is and has always been to develope a successful website and promote it and host it here until I exceed the limitation of my account. Once I max out my Xisto account, I'll move to paid hosting. As long as everything goes to plan, :D, if I have maxed out this account, I should be able to generate enough traffic to pay for my hosting cost through advertising. :)

    Anyone interested in PHP may join my website either for help or to share knowledge.

    Other than that, I just sit back, maintain the forum, make a few posts and enjoy my fantastic hosting account!

    vujsa

    Well well, only to say that i just register to HANDYPHP.COM and i see that you have good php resources, i hope that in the future i can contribute with your site.

    Best regards,

  6. I have used these sites in the past to help me along..

     

    This is a good site for users new to MySQL

    MYSQL Help

     

    And this site is great for more indepth stuff-look at the navpanel on the left for a list of other languages that they can help with..its very extensive!!

    MySQL Help2

     

    Marky;)

     

    Thanks for the links, very useful both of them and i just bookmark for future references.

     

    Best regards,


  7. I think its simply better to use the SMTP server that comes with Windows. Just goto your control panel > add remove applications > Windows components and then look out for IIS. Inside IIS you will find SMTP. Tick it, put in ur windows CD Rom, and then click ok. Everything will install properly if done properly :)

    You are right if done properly it will install properly but this doesnt means that it will work properly and based on my experience i really dont recommend this SMTP server because it is a bit difficult to admin and use it.

    He is using xampp, it has a mercury mail server, there are a lot of manuals outhere to enable and configure this mercury server..
    one thing to be sure.. you need 3 ports to be open to recieve emails and 1 or 2 ports for sending.. i was not sure about this one..

    on the IIS.. can this IIS smtp give access to php and apache? i have not tried that one..

    ********************************************

    I have a perfect method on how to enable email sending without using any smtp.. though you need to add phpmailer into your software package.. or i can also give the direction directly..

    be sure to have email and be sure to test your site in SSL mode.. https:// version
    Gmail requires you to be in SSL and you are required to connect to ssl://mail.gmail.com

    been using this one here..

    Can you please show us or post an URL to view how you do it??? i think that it will be very helpful for many people.

    Best regards,

  8. Hi, I use my space at http://forums.xisto.com/no_longer_exists/ for:

    debug web applications that i develop for my customers.

    test any kind of scripts (javascript, php, etc.) i found.

    investigate all the funtionallity of the CPanel web admin.

    store any kind of data i need to access everywhere.

    Right now my site is under construction so you cant find any thing at my frontpage, but if you wish you can view my Trivia Script i develop.

     

    Best regards,


  9. Your problem seems happen to me. But it was about 2 years ago when i start to learn PHP. When i saw this error message:I think that error happens because i didnt connect to internet. But I was wrong, this error message is appears because we haven't install a SMTP server on our computer. If someone on you using linux, you may never seen this error because linux has built-in SMTP server like sendmail or postfix.

    If you are using MS Windows, i highly suggest to use hMailServer as your SMTP server. It small, powerfull, easy to use and open source!. hMailServer can handle most email server like SMTP, IMAP, and POP3. For saving and storing data hMailServer bundled with MySQL server. But if have already install MySQL you can configure it when instalation. You can also use MS SQL server as database server.

    After installing hMailServer you can test it to check wheter it have configured well or not by using Outlook Express or other email client program.

    Hope's Help! :)

    First time i hear about this mail server, for a while i use the Argosoft Mail Server as i said in a previous post with good results, i search it to download and will test it to see how fine it works. Two things i like are that it is opensource :D and second the fact that this mail server uses a database to store and saving data.

    Here you can find the hMailServer

    Best regards,

  10. well, this is why TavoxPeru script dont work (i think) and answer to Aka_Bar
    Hosting servers and mostly free hosting servers limit massive mailing in PHP or even disable mailing in PHP
    all this doe to spamers, server, and agine, mostly free servers cant chack every singel user, if he is spaming or not!
    and if thay will do so, thay will have to read your mail and this is simply WRONG!!
    i am sure you dont want server admins to read your mail and i dont think this is even posible
    anyone here can be a mail spamer without anyone know it, and hackers sometimes use mailing system witch is unsecured and send mail spam with that script that created for privet use/none spam use
    those are the main resons why servers limits the mail function or massive mailing!
    and, now, why mostly free hostings?
    well, free hostings have register pages or forums, thay are not talking to the user, and the user can use the hosting in anyway he like and when he like
    but on paid host, the user PAY for the hosting and dont want it to close, so he will not send spam when he know that server owners can find out and kick him from the server

    and that was 60 sec about Hosting Servers and Mail Function :)

    NoMore

    Well, I understand and agree with the reasons you expose for hostings to do that to control spamming, but why this situation doesnt happens with the mailman that runs mailing lists??? is there a limit of how many emails one mailing list can have????

    Best regards,

  11. i havnt readed what you all wrote but my way is to put the mails in an array and send it in a while of a simple mail function, that way ppl cant see who wlse the mail sent to - you can create a log file to see how much it send and match it with mails so you can see how it works

    NoMore

    Well, i use a database to store my mailing list and its about 3000 records right now, and to send it i do the same thing as you, but i noticed that this doesnt work because no mail is send and also i test it with a little list of 10 records, so i gonna try the use of an array instead maybe this way it works.

    Best regards,

  12. i have just got hosting here on Xisto and i have to copy my databases from my old server...is there an easy way of doing this? in phpmyadmin?
    thanx in advance you know lol :)

    Yes, you can do this with phpmyadmin, you can do it with the import option if you first export your database as a sql file, take care with your databases charsets and versions, you can found some trouble with it.

    Best regards,

  13. not only is it working it seems to be working much faster now then it used to be
    When i send mass emails to all my members it usually took like 5 minutes

    now it takes like 30 seconds

    its insane
    well whatever you did it works great now so thx alot man

    Tell me something, which software do you use to send mass emails??? i'm looking for a good one to do this because i test some with bad results :)

    Best regards,

  14. i have fedora 5 and win2k and the latest versions of xampp for both. I able to login in linux the problem is in win2k . but i am editing the same in DW in win 2k.

    Well sherif, i dont use any kind of linux distro neither xampp, but i think the problem is related with the way your php is installed as i said you in my email, does your php is installed as cgi or as an apache module???

    Best regards,

  15. Is there a timeout setting or something of the sort in PHP or Apache? I'm building a file upload script that uploads a file and then adds a db entry in mysql with the file name and other info.... When I upload pictures everything works fine but when I upload larger .mov files it takes a little while which is expected then when the page loads my scripts tells me some of the fields were empty. If I echo all set variables, which contain the data from the fields, all of them are empty and I cannot figure out why
    Any help is appreciated

    Yes there are, the php function set_time_limit and the php.ini configuration setting max_execution_time, both controls how much time in seconds a script can run, if your script reach this value it produces a fatal error, the default value is of 30 seconds or, if it exists, the max_execution_time value defined in the php.ini, you can set this value to zero with the set_time_limit function, so no time limit is imposed and your script runs indefinitely.

    The other setting that you take in mind is the php.ini configuration setting max_input_time, that sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads.

    Other considerations to take in mind are the maximum size of your uploading files, you control this by using in your uploading form a hidden input named MAX_FILE_SIZE and setting its value property to the maximum size allowed in bytes for your uploading files. If you use this, you must put it before your input file control, for example, the following allows to upload a file of maximum 2Mb:

    <input type="hidden" name="MAX_FILE_SIZE" value="2097152"><input type="file" name="upload" size="30">
    Also, in your script you can verify if your script receives a file and if it does not exceeds your maximum file size you define in your uploading form by checking the size of your uploading file control with the following:

    if( ($_FILES['upload']['size'] == 0) ){		die("Error... Your file exceeds the maximum file size allowed");	   exit(); }
    Best regards,

  16. Ok guys I have a small loop for cycling through mysql entries and it is having problems somewhere that it will not get the last entry in the db.... What should happen during this section of the script is it should cathc 12 entries with P as the "Type" and then one entry at the end with a "Type" of M... But for some reason it only catches the 12 P's and not the one M
    I cannot not find the problem so I'm hoping for someone with a little more experience can find the problem.

    Thanks

    $counter = 0;while($row = mysql_fetch_array($result))   {	  if ($counter != 4)		 {	if ($row["Type"] == P)				   {					  echo "<td><a href='" . $row["Location"] . "'><img src='http://fjor.homeip.net" . $row['Location'] . "' width='175px' border='0'></a></td>";				   }	else				   {		  echo "<td><a href='dispMOV.php?file=" . $row["Location"] . "'><img src='media/movie.jpg' width='175px' border='0'></a></td>";		   			}	$counter++;		 }	  else		 {	echo "</tr><tr>";				$counter = 0;		 }}
    I dont completely understand your task, but, why you dont do 2 selects for this, the first one select the last 12 records of type P and then select the last record of type M, something like this:
    // obtain the last 12 records of type P$result=mysql_query("select * from table where table.type='P' order by table.id DESC limit 12") or die(mysql_error());// rest of your code// obtain the last record of type M$result=mysql_query("select * from table where table.type='M' order by table.id DESC limit 1") or die(mysql_error());// rest of your code
    Best regards,

  17. I assume that you are running your own webserver locally right???? well, this problem is because in windows you dont have a mail server installed by default -well not on the non server versions- you use a smtp server to send your mails like the one that comes with the IIS package, so, if i'm correct you have 2 options:

    Install and configure the SMTP server of the IIS package.

    Download, install, configure and run one free mail server like ARGOSOFT, download here.

    A few months ago, i try this last one, its very easy to install and configure also very simple to administer, and even it works with Dynamic DNS, so if you have a broandband connection at home you can use it as your mail server too.

     

    Best regards,


  18. Well I'm just starting to get back into web design and I need to create some pages that use databases, I know I used to have two different ways of accessing databases through pages. One was using PHP to use a microsoft access database and then I also used mysql.

     

    My question is before I go back and relearn everything, which method is best to use?

     

    Well, for me MySql is better than ms access and i recommend you to use it, some reasons why:

    Is open soUrce

    More stable

    Much easy to learn

    Lot of support

    The space of your databases are smaller, etc.

    Best regards,

  19. Well, there are .htaccess options but it you just want the file contents moved then there is a better option.

    Delete intivoyage/

    and then rename alex/ to intivoyage/

    If you require a cgi-bin in intivoyage/, then simply add a folder with that name there.

     

    If this isn't what you want to do, then we'll investigate other options.

     

    The server just looks for intivoyage/ as the root directory of intivoyage subdomain. Usually when I do a reinstall or difficult upgrade, I just rename the original folder and create a new fresh folder to start from. Then if there is a problem, I can always revert to the last good website by renaming a couple of folders.

     

    Hope This Helps. :P

     

    vujsa

     

    Thanks a lot, i will try the second option because it is more simple and i dont have much experience dealing with .htaccess files, so then i will post the results.

     

    Well, almost everything works fine with the exception that initially the images dont show, i need to access every one and then go back to see it correctly at the page and all of my links dont work because i use absolute paths so i need only to change this in my source files.

     

    Best regards,

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.