Jump to content
xisto Community

Alexandre Cisneiros

Members
  • Content Count

    22
  • Joined

  • Last visited

Posts posted by Alexandre Cisneiros


  1. Hi everybody. This is my 3rd script, but this dont use MySQL

    It does this: divide the site in SECTIONS and PAGES.

    Benefits:

    -You have to create just the text of your pages, no create ech page with the entire layout again.

    -If its just the text that is included, you just have to have one page with the layout, witch is the INDEX.PHP.

    -If you chanche the layout in the index.php, you DONT HAVE TO change in the other pages.

     

    Here is the code:

    <?php //-----------------------------------------// //ACAF Paginação                           // //by Alexandre Cisneiros                   // //-----------------------------------------// $section2=$_GET['section']; $page2=$_GET['page']; if(file_exists("$section2/$page2.php")){ include("$section2/$page2.php"); } else if($section2 != '' && $page2 == ''){     if(file_exists("$section2/index.php")){     include("$section2/index.php");     } } else if($section2 == "index"  || $section2 == "home" || $section2 == "default" || $section2 == ''){ include("main_page.php"); } else{ echo ("404: The page was not found."); } ?>
    How to use:

    If you want to have a page caled 'my_book.php' in the directory 'library', you can create a link like this:

    http://ww38.yoursite.com/index.php?section=ry&page=my_book

    or just

    http://ww38.yoursite.com/?section=libary&page=my_book

     

    To crate a link to the index, you have 4 options:

    http://ww38.yoursite.com/ ----JUST THE SITE ADRESS, WITH NOTHIS AFTER IT

    http://ww38.yoursite.com/?section=index

    http://ww38.yoursite.com/?section=main

    http://ww38.yoursite.com/?section=deafult

    This will load a page called PRINCIPAL.PHP (lower case)

     

    To create a link to the INDEX.PHP (lower case) of some SECTION, do this:

    http://ww38.yoursite.com/?section=my_section

    This will include the index.php of the directory MY_SECTION (lower case, again, B) )

     

    ---------REMEBER--------

    -The files HAVE TO BE IN .php !

    -The falis MUST


  2. Hi! This is my 2nd code of PHP + MySQL.
    This code is VERY simple: it encript the data in the MySQL DB. Here we go!
    ------------------------------------------------------------------------

    <?php $password = "abc"; $new_password = md5($password); echo $new_password; ?>
    The password "abc" was codfied using md5()
    This will be: 900150983cd24fb0d6963f7d28e17f72
    <?php $normal_pass = "abc"; $encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($normal_pass) == $encripted_pass)   echo "Login Sucessful!"; else   echo "Incorrect password."; ?>
    This check if the password in the var is the "same" as the password in the DB

  3. Hi! I will post here a code for separating the results of MySQL in pages.
    You ask: Why separete?
    I answer: Imagin that you have 1523 results to display. I dont have to say anything. =P
    Here is it.
    -------------------------------------------------------------------

    <?php$conect = mysql_connect("host","user","password");$select_db = mysql_select_db("database");$query = "SELECT * FROM mytable";$results = "15"; //Number of results displayed per page.if (!$page) {	$counter = "1";} else {	$pcounter = $page;}$start = $counter - 1;$start = $counter * $results;$limit = mysql_query("$query LIMIT $start,$results");$all = mysql_query("$query");$total_registers = mysql_num_rows($all);$total_pages = $total_registers / $results;//---------NOW LETS SHOW EVERYTHING!! =Dwhile ($data = mysql_fetch_array($limit)) {	$name = $data["name"];	echo "Name: $name<br>";}$prev = $counter -1;next = $counter +1;if ($counter>1) {	echo " <a href='?page=$prev'><- Previous</a> ";}echo "|";if ($counter<$total_pages) {	echo " <a href='?pagina=$next'>Next -></a>";}?>

    [[MODERATOR PLEASE DELETE THIS POST AND EDIT MY FIRST POST]]
    <?php$conect = mysql_connect("host","user","password");$select_db = mysql_select_db("database");$query = "SELECT * FROM mytable";$results = "15"; //Number of results displayed per page.if (!$page) {	$counter = "1";} else {	$counter = $page; //CHANGE 'pcounter' to 'counter'}


  4. I don't know for a fact, so I could be 100% wrong, but I would assume that once you are online with a mobile device the entire web is accessible, just like on here. I mean there are the normal web access fee's for mobile devices, but I can't imagine getting cut off from sites from other countries.....
    Someone let me know if I'm wrong on that...

    Yes, it's true.

    But imagin: Your mobile fone is charged by each Megabyte. Now imagin the money that you will pay loading lots of pictures, like logos, emoticons, etc, in GIF or JPG (becose in WAP you use WBMP as image type, and is much smaller).

    Once the user of your WAP site is very rich, is a little impossible acecss your site many times by the phone.

  5. Putfile is a free digital media hosting service. Here you can upload videos and images to the internet for free.

     

    You can upload:

    Media Type......Accepted Extensions............................Max Size........Number of Uploads

    Images..........jpg, .jpeg .gif, .png..........................2MB.............Unlimited

    Video...........wmv .avi .mpg .mpeg .mov .asf .asx .mp4 .3g2...25MB............Unlimited

    Audio ..........mp3 .mid .wav .midi............................25MB............Unlimited

    Flash...........swf............................................25MB............Unlimited

     

    You can be a member or not. If you are a member, you can have a custom page with your files separated in Picrutes and Media.

     

    http://forums.xisto.com/no_longer_exists/ - Putfile!


  6. Instead of using a bunch of elseif statements why not a CASE in a switch or even better, why not just have a drop down box or graphics that allow a user to choose the language themselves?

     

    Ok. Here is it:

    switch ($HTTP_ACCEPT_LANGUAGE) {case "en-us": header("Location: index_eng.html");break;case "en-uk": header("Location: index_enuk.html");break;case "pt-br": header("Location: index_ptbr.html");break;}// ETC......

    The reason you should not attempt to send some one to a particular language would be that they are on a computer that might not be their own and possibly if they are in another country while using that computer. On my sites you have 33 Flags representing 33 various languages that the user selects when coming to the site, and in my forums they can choose from 20 languages including English with two forms of Chinese and two forms of German. There they must of course choose the language themselves, but of course this is only if they are members since the only way to change your profile is to be a member.

    [1064337012[/snapback]


    You can add it on the site. Example:

    AFTER REDIRECT, YOU CAN OUT THIS ON EACH PAGE:

    //////////////////////////////////

    Choose your language: [ box with langueages] [ Ok button]



  7. Features

     

    Besided the option to upload new "modules", which is a must have, you ought to have user accounts, and if you want something else, for example a forum, you would have to make it yourself, which could be a problem.

    1064336850[/snapback]


    Sorry, I could not understand this... I'm going do make the modules like forums, downloads, etc. by my self.

    But I want to know if is better the CMS comes with manny modules, or only the module User-accounts, and who download it (will be open-source) goes to the site and download the modules that he/she wants.


  8. Hi!

    I'm here to ask your opinion:

    I'm going to create my CMS based on PHP (i isn't named yet) and i what you thing that is more important.

    Please answer this questions:

     

    Multilingual Suport:

    -With Languages?

     

    Features:

    -Forums?

    -Downloads?

    -Blog?

    -User account?

    -Or just it comes with User account and the user who wants download the separetad modules?

     

    Templates:

    -If you download a CMS, you prefer to download it with only the default template and get separated templates, or download with many (3-8) templates?

     

    Database:

    -MySQL?

    -PostgreeSQL?

    -Other database?

    -Many databases?

     

    Others:

    -Leave sugestions, please!

     

    ---------------------------------------

    If you can help-me, please reply this topic.


  9. Hi! I found this Newsletter System, based on TXT files, not MySQL. It is VERRY simple. Here is the instructions:

     

    ----------------------------------------------

    |### Newsletter System 1.0 L.E. ###|

    ----------------------------------------------

    Leandro Maniezo

    lemaniezo@ig.com.br

     

    TRANSLATION FROM PORTUGUESE-BR TO ENGLISH:

    Alexandre Cisneiros Filho

    misteryoshi@gmail.com

     

     

    Introduction

    ----------

     

     

    - Put line-by-line the adresses on the file emails_bd.txt.

     

    - Set the permitions of the txt files to be writebly.

     

    - After sendin, all the adresses who recived the message are stored at log.txt.

     

    - If some people dont recive the message, deleta all adresses on the file emails_bd that are in log.txt and send again.

     

     

    Instaling

    ----------

     

    - Put all the files in a folder on the site and set the permitions to the TXT files.

     

    Obs.: NO Javascript allowed.

    If you want to send images, you need to host them.

     

    Just download the attached file!


  10. I use shortURL, and is verry good. Thgey have MANY features. There are:
    .Many Sub-domain options:
    -yourname.shorturl.com
    -yourname.2ya.com
    -yourname.vze.com
    -yourname.1sta.com
    -yourname.24ex.com
    -yourname.morroz.com
    AND MORE! There are 25 options!

    .Suport for WWW:
    If the user puts www. before the adress of your shortURL, it goes to your page normaly! No 404 Errors!

    .Path Forwarding:
    If you have the ShortURL yourname.vze.com and the real URL of your site is


    hosting.com/members/yourname and want to acess the diredory /joe in your real URL, you can create a link to yourname.vze.com/joe.

    .Prefix Path Forwarding:
    The same of the above feature, but is like this:
    To acess /joe, point the brouwser to joe.yourname.vze.com.

    .Prefix Forwarding:
    If you point the browser to yourname.vze.com or to joe.yourname.vze.com, you will go to the same point: the main page of your site.

    WARING: Chose this feature or teh Prefix Path Forwarding.

    .URL Masking:
    Normally, after your ShortURL.com forwards to your real URL, your real URL is then shown in the browser's address bar. Turning on URL masking, allows you to keep your ShortURL in the address bar by using a hidden frame trick. This frame is invisible to the user. Then, if visitors bookmark your site, they bookmark your ShortURL, and search engines will link to your ShortURL as well. 95% of our users choose to use this feature.

    .Frame Kill:
    Frame Kill forces your site to pop out of any frames it may be loading in. For example if another website links to you and opens your site inside their frame.

    How does this work? If you have URL masking turned on, we insert JavaScript code into the hidden frame. If URL masking is off, we create an invisible and temporary page loading the JavaScript to first pop out your site then use HTML to forward the user. This process is invisible to the user, other than seeing your site pop out of a frame.

    Usefull to LYCOS users.


    .Traffic Reports:
    With a ShortURL address you will have access to traffic stats with daily and monthly reports displaying unique and raw visits and referring URLs. We also calculate your unique/raw ratio and daily averages.

    The Referring URL Report allows you to see where your visitors are coming from! An hourly report displays all the URLs that have sent traffic to your ShortURL address, as well as a list of keywords used to find your site in search engines.


    .Mirror Management:
    If you have mirrors of your site you can use your ShortURL to balance traffic between them, or provide redundancy.

    This can be done two ways: 1) You can have ShortURL randomly forward to a mirror, weighing any URLs you wish to get more or less traffic. 2) Or, have ShortURL generate a page, providing visitors with a list your mirrors to choose from along with a description for each one.

    .Private Networks / Specific Ports:
    If you have a home/office network, and you can get your website to load:
    ip-address-here/ then you can point a ShortURL there. If you need to get around a pesky port 80 block, then you can setup your server to work on another port (ie. 81) and include the number in the target URL by using:
    ip-address-here/

    ATTENTION: shortURL puts one little, verry little frame on bottom of your page, nut if you upgrade to Premium, it disapears.
    Get the Premium by 2 manners:
    Paying
    or completing one of the partner campains. It consist in completing a survey, or sign up to one site, etc...

    shortani.gif
    shortURL
    Free Short URL since 1999.

    shorturl.com/




  11. @Alexandre : your program has a great advantage, you are independent from any provider, so you can use it on a server other than Xisto, or even on a server on a private network.

     

    yes, it has to be tested first. For instance, I am curious to see where $dados is defined.

    1064336637[/snapback]

    Sorry, is not $dados['visits'], but $visits['visits']

    Sorry again for the mistake.


  12. If you want one more secure counter, use MySQL Database!
    You just have to:

    CREATE TABLE website_counter(visits int(10))
    And put this code in the top of each page that you want to be counted:

    $conn = mysql_connect("YOUR HOST","YOUR USER","YOUR PASSWORD") or die('MySQL said:  ' . mysql_error());$db = mysql_select_db($db);$sql = mysql_query("SELECT * FROM website_counter") or die('MySQL said:  ' . mysql_error());while($visits = mysql_fetch_array($sql)){$visits = $dados["visits"];$visits_new = $visits + 1;}$query = "UPDATE TABLE website_counter SET visits = $visits_new"; mysql_query($query, $conn) or die(mysql_error());

    And where you want to show the number os visits:
    echo ("Visits: $visits_new");

    OBS.: I didn't test it. If you got any errors, post here.

  13. If you have one site in diferent laanguages, this simple script can redirect the user to the correct page acording to his/her language:

     

    <?php // Enslish EUA elseif ($HTTP_ACCEPT_LANGUAGE == "en-us"){ header("Location: index_eng.html"); } // InglĂŞs UK elseif ($HTTP_ACCEPT_LANGUAGE == "en-gb"){ header("Location: ingles_enuk.html"); } // Portuguese [Brazil] if ($HTTP_ACCEPT_LANGUAGE == "pt-br"){ header("Location: index_ptbr.html"); } //German elseif ($HTTP_ACCEPT_LANGUAGE == "de-de"){ header("Location: index_ger.html"); } // Swedish elseif ($HTTP_ACCEPT_LANGUAGE == "sv-se"){ header("Location: index_swe.html"); } // French elseif ($HTTP_ACCEPT_LANGUAGE == "fr-fr"){ header("Location: index_fre.html"); } // Chineseelseif ($HTTP_ACCEPT_LANGUAGE == "zh-cn"){ header("Location: index_chi.html"); } // Thai elseif ($HTTP_ACCEPT_LANGUAGE == "th-th"){ header("Location: index_tha.html"); } ?> 

    -----This is not a full tutorial, but just a little code snippet. Moved from [Tutorials > Programming > PHP] to [Programming > Scripting > PHP]-----szupie

     

    Now i saw that EDIT is disabled, so this is a correction:

     

    CHANGE THE FIRSTS 3 IF's to this:///////////////////////////////////////////////////////<?php // Enslish EUA if ($HTTP_ACCEPT_LANGUAGE == "en-us"){ header("Location: index_eng.html"); } // InglĂŞs UK elseif ($HTTP_ACCEPT_LANGUAGE == "en-gb"){ header("Location: ingles_enuk.html"); } // Portuguese [Brazil] elseif ($HTTP_ACCEPT_LANGUAGE == "pt-br"){ header("Location: index_ptbr.html"); } ////////////////////////////////////////////////////////THE REST IS OK.


  14. Many people have the SQL database full, so here is a script called "NoSQL". The NoSQL simulate a SQL database, but save the files in .CVS format.

     

    Example:

    If in SQL, you want to do this:

    SELECT * FROM $table WHERE $var = $value
    You just have to do this:

    nosql_SelectAllFromWhere($table,$var,"=",$value);

    The file is atached. It have all the istructions, with all the commands in the file "index.html". To use NoSQL, just include("nosql.php"); and use it FREE!!

     

    Bye everybody!


  15. Google Labs is the site where you can find the Google Servidcs thad wasn't relaced oficialy, and ae in BETA version:

    Labs.google.com, Google's technology playground.

    Google labs showcases a few of our favorite ideas that aren't quite ready for prime time.

    What you can find there:

    -Google Web Accelerator

    Save time online by loading web pages faster

     

    -Google Reader

    Use Google's web-based feed reader to keep up with what's important to you

     

    -Froogle Mobile US or UK

    Search for products from your mobile phone using Froogle

     

    ---------AND MUCH MORE!

     

    Why you are losing time?

    Visit now: https://www.google.de/?gfe_rd=cr&ei=pBslVPOQBMaH8Qfe8oG4BA&gws_rd=ssl

×
×
  • 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.