elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Temas
Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ... 39
161  Programación / Desarrollo Web / Modificar este javascript? en: 3 Mayo 2012, 19:06 pm
Hola a todos, buscando por Internet como podía de alguna u otra manera obtener información acerca de un iframe externo (clic, mouse encima, mouse sobre).

Encontré lo siguiente:
Código
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  3. <title>Detect IFrame Clicks</title>
  4.  
  5. <style type="text/css">
  6. #outerdiv2 { width:330px; height:190px; overflow:hidden; position:relative; z-index: 2; }
  7. #inneriframe2 { position:absolute; top:-170px; left:-390px; width:1280px; height:1200px; z-index: 2; }
  8. </style>
  9.  
  10.  
  11. <script type="text/javascript">
  12.  
  13.  
  14. var isOverIFrame = false;
  15.  
  16. function processMouseOut() {
  17. log("IFrame mouse >> OUT << detected.");
  18. isOverIFrame = false;
  19. top.focus();
  20. }
  21. function processMouseOver() {
  22. log("IFrame mouse >> OVER << detected.");
  23. isOverIFrame = true;
  24. }
  25. function processIFrameClick() {
  26. if(isOverIFrame) {
  27. // document.getElementById('modificar').style.display = 'none';
  28. log("IFrame >> CLICK << detected. ");
  29. }
  30. }
  31. function log(message) {
  32. var console = document.getElementById("console");
  33. var text = console.value;
  34. text = text + message + "\n";
  35. console.value = text;
  36. }
  37. function attachOnloadEvent(func, obj) {
  38. if(typeof window.addEventListener != 'undefined') {
  39. window.addEventListener('load', func, false);
  40. } else if (typeof document.addEventListener != 'undefined') {
  41. document.addEventListener('load', func, false);
  42. } else if (typeof window.attachEvent != 'undefined') {
  43. window.attachEvent('onload', func);
  44. } else {
  45. if (typeof window.onload == 'function') {
  46. var oldonload = onload;
  47. window.onload = function() {
  48. oldonload();
  49. func();
  50. };
  51. } else {
  52. window.onload = func;
  53. }
  54. }
  55. }
  56. function init() {
  57. var element = document.getElementsByTagName("iframe");
  58. for (var i=0; i<element.length; i++) {
  59. element[i].onmouseover = processMouseOver;
  60. element[i].onmouseout = processMouseOut;
  61. }
  62. if (typeof window.attachEvent != 'undefined') {
  63. top.attachEvent('onblur', processIFrameClick);
  64. }
  65. else if (typeof window.addEventListener != 'undefined') {
  66. top.addEventListener('blur', processIFrameClick, false);
  67. }
  68. }
  69. attachOnloadEvent(init);
  70. </script>
  71. </head>
  72.  
  73. <div id="outerdiv2"><iframe src="http://www.xtremetop100.com/in.php?site=1132331256" id="inneriframe2" scrolling="no"></iframe></div>
  74.  
  75. <br></br>
  76. <br></br>
  77. <form name="form" id="form" action=""><textarea name="console"
  78. id="console" style="width: 100%; height: 300px;" cols="" rows=""></textarea>
  79. <div id="modificar"><button name="clear" id="clear" type="reset">Clear</button></div>
  80. </form>
  81. </body>
  82. </html>

Al probarlo funciona de maravilla (este me muestra en una caja de texto las acciones detectadas dentro del iframe). Pero me gustaría especificar que fueran capturadas una zona específica dentro del iframe, esta parte sería sólo el botón del iframe (vote for Mu Caos).

¿Como podría hacer esto?
Se lo agradecería considerablemente. Espero no molestar, muchísimas gracias por tomarse el tiempo en leer. Saludos
162  Programación / PHP / Mostrar banderas según codigo de pais hubicado en una BD en: 29 Abril 2012, 01:31 am
Hola a todos, tal como lo dice el título tengo el siguiente problema:
tengo una BD (mssql) en donde en un campo se encuentra un número, este número representa un país, me gustaría que se mostrara una banderita en la web según el código obtenido de la BD, la estructura de la BD es la siguiente:

BD:MuOnline

Tabla:MEMB_INFO

campo:country



Quiero implementar un PHP que muestre un ranking (el nº 1 de un juego).
Funciona casi todo perfecto, el único problema que encontré es al momento de querer mostrar las banderas, según el país en donde reside el personaje Nº1, este me muestra siempre la 1era bandera (1.png).

para entenderlo de manera visual pueden visitar la página (en el mismo index, abajo muestra el TOP 1):
www.mu-caos.cl

El código es el siguiente:
Código
  1. <table border=0 align=left width="476" height="234" cellpadding=0 cellspacing=0  background="template/<?=$core['config']['template'] ?>/images/Top1.png">
  2. <tr>
  3. <td>
  4. <b>
  5.  <div align="center">
  6.    <blockquote>
  7.      <p><font color="#FFFFFF" size=3 face="arial,verdana" align="right" >
  8. <br>
  9. <br>
  10. <br>
  11. <br>
  12. <br>
  13.        <?
  14.  
  15. function flag($country){
  16. $flags_array=array(
  17.  
  18. 1=>"1",2=>"2",3=>"3",4=>"4",5=>"5",6=>"6",7=>"7",8=>"8",9=>"9",10=>"10",11=>"11",12=>"12",13=>"13",14=>"14",15=>"15",16=>"16",17=>"17",18=>"18",19=>"19",20=>"20",21=>"21",22=>"22",23=>"23",24=>"24",25=>"25",26=>"26",27=>"27",28=>"28",29=>"29",30=>"30",31=>"31",32=>"32",33=>"33",34=>"34",35=>"35",36=>"36",37=>"37",38=>"38",39=>"39",40=>"40",41=>"41",42=>"42",43=>"43",44=>"44",45=>"45",46=>"46",47=>"47",48=>"48",49=>"49",50=>"50",51=>"51",52=>"52",53=>"53",54=>"54",55=>"55",56=>"56",57=>"57",58=>"58",59=>"59",60=>"60",61=>"61",62=>"62",63=>"63",64=>"64",65=>"65",66=>"66",67=>"67",68=>"68",69=>"69",70=>"70",71=>"71",72=>"72",73=>"73",74=>"74",75=>"75",76=>"76",77=>"77",78=>"78",79=>"79",80=>"80",81=>"81",82=>"82",83=>"83",84=>"84",85=>"85",86=>"86",87=>"87",88=>"88",89=>"89",90=>"90",91=>"91",92=>"92",93=>"93",94=>"94",95=>"95",96=>"96",97=>"97",98=>"98",99=>"99",100=>"100",101=>"101",102=>"102",103=>"103",104=>"104",105=>"105",106=>"106",107=>"107",108=>"108",109=>"109",110=>"110",111=>"111",112=>"112",113=>"113",114=>"114",115=>"115",116=>"116",117=>"117",118=>"118",119=>"119",120=>"120",121=>"121",122=>"122",123=>"123",124=>"124",125=>"125",126=>"126",127=>"127",128=>"128",129=>"129",130=>"130",131=>"131",132=>"132",133=>"133",134=>"134",135=>"135",136=>"136",137=>"137",138=>"138",139=>"139",140=>"140",141=>"141",142=>"142",143=>"143",144=>"144",145=>"145",146=>"146",147=>"147",148=>"148",149=>"149",150=>"150",151=>"151",152=>"152",153=>"153",154=>"154",155=>"155",156=>"156",157=>"157",158=>"158",159=>"159",160=>"160",161=>"161",162=>"162",163=>"163",164=>"164",165=>"165",166=>"166",167=>"167",168=>"168",169=>"169",170=>"170",171=>"171",172=>"172",173=>"173",174=>"174",175=>"175",176=>"176",177=>"177",178=>"178",179=>"179",180=>"180",181=>"181",182=>"182",183=>"183",184=>"184",185=>"185",186=>"186",187=>"187",188=>"188",189=>"189",190=>"190",191=>"191",192=>"192",193=>"193",194=>"194",195=>"195",196=>"196",197=>"197",198=>"198",199=>"199",200=>"200",201=>"201",202=>"202",203=>"203",204=>"204",205=>"205",206=>"206",207=>"207",208=>"208",209=>"209",210=>"210",211=>"211");
  19.  
  20. $img= isset($flags_array[$country]) ? $flags_array[$country] : "2";
  21.  
  22. return "<img src=template/DarkBrown/images/banderas/{$img}.gif  width='25' height='15' >";
  23. }
  24.  
  25.  
  26.  
  27.  $Top = mssql_query("select top 1 name from MuOnline.dbo.character where ctlcode<32 order by Grand_Resets desc");
  28.  for($i;$i<mssql_num_rows($Top);$i++) {
  29.  $MuTop = mssql_fetch_row($Top);
  30.  
  31.  $country = mssql_query("Select memb___id,country from  MEMB_INFO where memb___id='".$MuTop[0]."'");
  32.  $country->fields[1] = flag($country->fields[1]);
  33. echo '
  34.  <u>Personaje</u>: &nbsp <font color="#FF0000"><strong>'.$MuTop[0].'</strong></font> &nbsp <font color="#FFFFFF"><u>Pais</u>: '.$country->fields[1].'
  35. '; }
  36. ?>
  37.        <br/>
  38.      </font></p>
  39.    </blockquote>
  40.  </div></td>
  41. </tr>
  42. </table>

Si alguien me explicara en que estoy fallando se lo agradecería mucho, tengo nociones muy básicas de PHP, por eso acudo a ustedes. Muchas Gracias

163  Programación / Desarrollo Web / Adonde introduzco esto en mi httpd.conf en: 14 Marzo 2012, 19:13 pm
Hola a todos encontré un código que se encarga de "obligar" a los navegadores almacenar el cache de algunas imágenes por un mayor tiempo, esto con la finalidad de que disminuya un poco el consumo por el flujo. Mi duda es en que parte de httpd.conf introduzco el código?:

Citar
ExpiresActive On
ExpiresByType text/css "access plus 1 day"
ExpiresByType application/javascript "access plus 1 day"
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png "access plus 30 days"

Preg: los " " son comentarios verdad?

Aquí mi httpd.conf:


Citar
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned. 
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
# with ServerRoot set to "C:/xampp/apache" will be interpreted by the
# server as "C:/xampp/apache/logs/foo.log".
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum  number of requests a server process serves
ThreadsPerChild 250
MaxRequestsPerChild  0

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "C:/xampp/apache"

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
#LoadModule disk_cache_module modules/mod_disk_cache.so
#LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule charset_lite_module modules/mod_charset_lite.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
LoadModule mime_module modules/mod_mime.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule speling_module modules/mod_speling.so
LoadModule status_module modules/mod_status.so
LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule version_module modules/mod_version.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule ssl_module modules/mod_ssl.so

#LoadModule autoindex_color_module modules/mod_autoindex_color.so
#LoadModule mysql_auth_module modules/mod_auth_mysql.so
#LoadModule auth_remote_module modules/mod_auth_remote.so
#LoadModule sspi_auth_module modules/mod_auth_sspi.so
#LoadModule log_sql_module modules/mod_log_sql.so
#LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
#<IfModule ssl_module>
#    LoadModule log_sql_ssl_module modules/mod_log_sql_ssl.so
#</IfModule>
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule xmlns_module modules/mod_xmlns.so
#LoadModule proxy_xml_module modules/mod_proxy_xml.so
#LoadModule bw_module modules/mod_bw.so

### SVN from XAMPP devel package ###
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so

# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin admin@localhost

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:80

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/xampp/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/xampp/htdocs">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI
   
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

<IfModule log_config_module>
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    CustomLog logs/access.log common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog logs/access.log combined
</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to
    # exist in your server's namespace, but do not anymore. The client
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.

    #
    # ScriptAlias: This controls which directories contain server scripts.
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"

</IfModule>

#
# "C:/xampp/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "C:/xampp/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script.  For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:

   #!c:/program files/perl/perl

# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file.  Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention.  The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab.  Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig conf/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    AddHandler cgi-script .cgi

    # For files that include their own HTTP headers:
    #AddHandler send-as-is asis

    # For server-parsed imagemap files:
    #AddHandler imap-file map

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
   AddType text/html .shtml
   AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall is used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
#
EnableMMAP off
EnableSendfile off

# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.

# XAMPP specific settings
Include conf/extra/httpd-xampp.conf

# Server-pool management (MPM specific)
# Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf

# User home directories
Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf

# Various default settings
Include conf/extra/httpd-default.conf

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
164  Programación / PHP / Alinear formulario web en: 5 Marzo 2012, 18:32 pm
Hola a todos, bueno tengo la siguiente duda, como podría alinear un formulario en base a nombre de la cuenta?, adjunto imagen:



adjunto register.php:

Código
  1. <?
  2.  
  3. $get_config = simplexml_load_file('engine/config_mods/register_settings.xml');
  4. if($get_config->active == '0'){
  5. echo msg('0',text_sorry_feature_disabled);
  6. }else{
  7. $register_method = $get_config->method;
  8.  
  9. $verification_config = simplexml_load_file('engine/config_mods/human_verification.xml');
  10. if($verification_config->human_verification_type == 'reCAPTCHA'){
  11. $is_reCAPTCHA = '1';
  12. require_once('engine/recaptchalib.php');
  13. $privatekey = $verification_config->reCAPTCHA_private_key;
  14. $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);
  15. }
  16.  
  17.  
  18.  
  19. echo '
  20. <script type="text/javascript">    
  21. load_image= new Image(16,16);
  22. load_image.src="template/'.$core['config']['template'].'/images/load.gif";
  23.  
  24. function Ajax(div,id, page, form, append, data){
  25.  
  26.    document.getElementById(div).innerHTML = \'<img src="template/'.$core['config']['template'].'/images/load.gif" width="16" height="16"> Please wait...\';
  27. var veri = \'\';
  28. if( typeof(data) == "string")
  29. veri = data;
  30. else
  31. veri = $(form).serialize();
  32. $.ajax({
  33.   type: "POST",
  34.   url: page,
  35.   data: veri,
  36.   error: function(html)
  37.   {
  38.   alert("falied");
  39.   },
  40.   success: function(html)
  41.   {
  42.     if( typeof(append) == "boolean")
  43. $(id).append(html);
  44. else
  45. $(id).html(html);
  46.   }
  47.  });
  48.  return false;
  49. }
  50. </script>
  51.  
  52. <script type="text/javascript">
  53. function cs_ua_a(){
  54. if (document.sign_up_frm.userid.value.length < 4){
  55. alert(\'User ID, 4-10 characters\n(letters and numbers only)\');
  56. }else{
  57. uss = document.getElementById(\'userid\').value;
  58. url_p = "get.php?aA="+uss;
  59. Ajax(\'c_uss\',\'#c_uss\',url_p, null, \'data=c_uss\');
  60. }
  61.  
  62. }
  63.  
  64. function csm_uam_am(){
  65. if (document.sign_up_frm.email_address.value.length < 2){
  66. alert(\'Please enter an valid mail address \n(e.g: somebody@yahoo.com)\');
  67. }else{
  68. uss = document.getElementById(\'email_address\').value;
  69. url_p = "get.php?aMl="+uss;
  70. Ajax(\'c_mss\',\'#c_mss\',url_p, null, \'data=c_mss\');
  71. }
  72.  
  73. }
  74.  
  75. function parse_inputs(){
  76. if (document.sign_up_frm.userid.value.length < 4){
  77. alert(\'User ID, 4-12 characters\n(letters and numbers only)\');
  78. return false;
  79. }
  80.  
  81. if (document.sign_up_frm.password.value.length < 6){
  82. alert(\'Password, 6-12 characters\n(letters and numbers only, passwords are case-sensitive.)\');
  83. return false;
  84. }
  85.  
  86. if (document.sign_up_frm.confirm_password.value.length < 6){
  87. alert(\'Confirm Password, 6-12 characters\n(letters and numbers only, passwords are case-sensitive.)\');
  88. return false;
  89. }
  90. if (document.sign_up_frm.password.value != document.sign_up_frm.confirm_password.value){
  91. alert(\'Passwords did not match.\');
  92. return false;
  93. }
  94. ';
  95. if($get_config->pers_id_active == '1'){
  96. echo 'if (document.sign_up_frm.pers_id.value.length < '.$get_config->pers_id_length.'){
  97. alert(\'Please enter an valid Personal ID number \n(12 digits, numbers only.)\');
  98. return false;
  99. }';
  100. }
  101.  
  102. echo '
  103. if (document.sign_up_frm.email_address.value.length < 2){
  104. alert(\'Please enter an valid mail address \n(e.g: somebody@gmail.com)\');
  105. return false;
  106. }
  107. if (document.sign_up_frm.country.value ==  \'x\'){
  108. alert(\'Please select country.\');
  109. return false;
  110. }
  111. if ((document.sign_up_frm.gender[0].checked==false)&&(document.sign_up_frm.gender[1].checked==false)){
  112. alert(\'Please select gender.\');
  113. return false;
  114. }
  115. if (document.sign_up_frm.question.value ==  \'x\'){
  116. alert(\'Please select question.\');
  117. return false;
  118. }
  119. if (document.sign_up_frm.answer.value.length < 4){
  120. alert(\'Please enter the answer to your secret question.\n(letters and numbers only)\');
  121. return false;
  122. }';
  123. if($is_reCAPTCHA != '1'){
  124. echo ' if (document.sign_up_frm.verify_int.value.length < 6){
  125. alert(\'Please enter the code from verification image.\');
  126. return false;
  127. }';
  128.  
  129. }
  130.  
  131.  
  132. echo '
  133. if ((document.sign_up_frm.terms.checked==false)){
  134.    alert(\'Please read the Terms of Service.\');
  135.    return false;
  136. }
  137.  
  138. document.sign_up_frm.submit();
  139. }
  140.  
  141. </script>';
  142.  
  143.  
  144. if(isset($_POST['create_account'])){
  145.  
  146.  
  147.  
  148. require("engine/validate.php");
  149. $elems[] = array('name'=>'userid','label'=>text_register_error1, 'type'=>'text','uname'=>'true', 'required'=>true, 'len_min'=>4,'len_max'=>10, 'cont' =>'alpha');
  150.  
  151.  
  152. $elems[] = array('name'=>'password', 'label'=>text_register_error2, 'type'=>'text', 'required'=>true, 'len_min'=>6,'len_max'=>12, 'cont' =>'alpha');
  153. $elems[] = array('name'=>'confirm_password', 'label'=>text_register_error3,'type'=>'text', 'required'=>true, 'len_min'=>6,'len_max'=>12, 'cont' =>'alpha','equal'=> array('password'));
  154.  
  155. if($get_config->pers_id_active == '1'){
  156. $elems[] = array('name'=>'pers_id', 'label'=>str_replace("{pers_id_length}",$get_config->pers_id_length,text_register_error4),'type'=>'text', 'required'=>true, 'len_min'=>$get_config->pers_id_length,'len_max'=>$get_config->pers_id_length, 'cont' =>'digit');
  157. }
  158.  
  159. $elems[] = array('name'=>'email_address', 'label'=>text_register_error5, 'type'=>'text', 'required'=>true, 'len_max'=>50, 'cont' => 'email');
  160.  
  161. $elems[] = array('name'=>'country', 'label'=>text_register_error6,'type'=>'text', 'required'=>true, 'len_max'=>3, 'cont' =>'digit');
  162. $elems[] = array('name'=>'gender', 'label'=>text_register_error7,'type'=>'text', 'required'=>true, 'len_max'=>1, 'cont' =>'digit');
  163. $elems[] = array('name'=>'question', 'label'=>text_register_error8,'type'=>'text', 'required'=>true, 'len_max'=>2, 'cont' =>'digit');
  164.  
  165. $elems[] = array('name'=>'answer', 'label'=>text_register_error9,'type'=>'text', 'required'=>true, 'len_min'=>4,'len_max'=>20, 'cont' =>'alpha');
  166. $f = new FormValidator($elems);
  167. $err = $f->validate($_POST);
  168. if ( $err === true ) {
  169. $valid = $f->getValidElems();
  170. foreach ( $valid as $k => $v ) {
  171. if ( $valid[$k][0][1] == false ) {
  172. if ( empty($valid[$k][0][2]) ) {
  173. $msg_error = msg('0',$valid[$k][0][2]);
  174. }else{
  175. $msg_error = msg('0',$valid[$k][0][2]);
  176. }
  177. }
  178. }
  179. } else {
  180. $userid = safe_input($_POST['userid'],'');
  181. $password = safe_input($_POST['password'],'');
  182. $email = safe_input($_POST['email_address'],'\_\@\.\-');
  183. $country = safe_input($_POST['country'],'');
  184. $gender = safe_input($_POST['gender'],'');
  185. $question = safe_input($_POST['question'],'');
  186. $anaswer = safe_input($_POST['answer'],'');
  187. if($get_config->pers_id_active == '1'){
  188. $pid = safe_input($_POST['pers_id'],'');
  189. }else{
  190. $pid = trim($get_config->pers_id);
  191. }
  192.  
  193.  
  194. if($is_reCAPTCHA == '1'){
  195. if(!$resp->is_valid){
  196. $bot_check = '1';
  197. }
  198. }else{
  199. if($_SESSION['SID_code'] != md5($_POST['verify_int'])){
  200. $bot_check = '1';
  201. }
  202. }
  203.  
  204.  
  205. if($bot_check == '1'){
  206. $msg_error = msg('0',text_register_error10);
  207.  
  208. }else{
  209. if(check_account($userid) === true){
  210. $msg_error =  msg('0',text_register_error11);
  211. }else{
  212. if(check_mail($email) === true){
  213. $msg_error = msg('0',text_register_error12);
  214. }else{
  215. if($register_method == '1'){
  216. $confirmed = '1';
  217. $blocked = '0';
  218. $activation_need = '0';
  219. $activation_id = md5($userid);
  220. }elseif ($register_method == '2'){
  221. $confirmed = '0';
  222. $blocked = '1';
  223. $activation_need = '1';
  224. $activation_id = md5($userid);
  225. }
  226.  
  227. if($core['config']['md5'] == '1'){
  228. $make_me_acc = $core_db2->Execute("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,bloc_code,ctl1_code,mail_chek,mail_addr,appl_days,modi_days,out__days,true_days,SecretQuestion,SecretAnswer,Country,Gender,confirmed,activation_id) VALUES (?,[dbo].[fn_md5](?,?),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",array($userid,$password,$userid,'test',$pid,$blocked,'0','1',$email,date('m/d/Y'),date('m/d/Y'),'2005-01-03','2005-01-03',$question,$anaswer,$country,$gender,$confirmed,$activation_id));
  229. }elseif($core['config']['md5'] == '0'){
  230. $make_me_acc = $core_db2->Execute("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,bloc_code,ctl1_code,mail_chek,mail_addr,appl_days,modi_days,out__days,true_days,SecretQuestion,SecretAnswer,Country,Gender,Confirmed,activation_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",array($userid,$password,'test',$pid,$blocked,'0','1',$email,date('m/d/Y'),date('m/d/Y'),'2005-01-03','2005-01-03',$question,$anaswer,$country,$gender,$confirmed,$activation_id));
  231. $make_me_acc_ = 1;
  232. /*
  233. $make_me_acc_ = $core_db2->Execute("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2005','1',1234,?,?,1,'7','6','3','6','6',".date('m/d/Y').",'0' )", array($userid,'test'));
  234. */
  235. }
  236. if($make_me_acc){
  237. if($activation_need == '0'){
  238. $msg_error = msg('1',str_replace("{userid}",$userid,text_register_success1));
  239. $complete = 1;
  240. }elseif ($activation_need == '1'){
  241. /*
  242. require("engine/smtp.php");
  243. $smtp_config = simplexml_load_file('engine/config_mods/smtp_settings.xml');
  244. $mail = new SMTP($smtp_config->smtp_server,$smtp_config->smtp_username,$smtp_config->smtp_password);
  245. $header = $mail->make_header($core['config']['master_mail'],$email,'Account Activation for '.$core['config']['websitetitle'].'');
  246. $header .= "Content-Type: text/html; charset=\"iso-8859-1\" \r\n";
  247. $header .= "Content-Transfer-Encoding: 8bit \r\n";
  248. $header .= "MIME-Version: 1.0 \r\n";
  249. */
  250.  
  251.  
  252. $body = str_replace("{user_id}",$userid,mail_register_t1);
  253. $body = str_replace("{website_title}",$core['config']['websitetitle'],$body);
  254. $body = str_replace("{activation_url}",$core['config']['website_url'].'/'.ROOT_INDEX.'?'.LOAD_GET_PAGE.'='.REGISTER_CMS_PAGE.'&activation_id='.$activation_id,$body);
  255. /*
  256.  
  257. $body = 'Dear '.$userid.',<br><br>
  258. Thank you for registering at the '.$core['config']['websitetitle'].'. Before we can activate your account one last step must be taken to complete your registration.<br><br>
  259. Please note - you must complete this last step to become a registered member. You will only need to visit this URL once to activate your account.<br>
  260. <br>
  261. To complete your registration, please visit this URL:<br>
  262. <a href="'.$core['config']['website_url'].'/'.ROOT_INDEX.'?'.LOAD_GET_PAGE.'='.REGISTER_CMS_PAGE.'&activation_id='.$activation_id.'">'.$core['config']['website_url'].'/'.ROOT_INDEX.'?'.LOAD_GET_PAGE.'='.REGISTER_CMS_PAGE.'&activation_id='.$activation_id.'</a>
  263. <br><br><br>
  264. All the best,<br>
  265. '.$core['config']['websitetitle'].' Team.';
  266. */
  267.  
  268.  
  269. if($core['debug'] == '1'){
  270. define('DISPLAY_XPM4_ERRORS', true);
  271. }else{
  272. define('DISPLAY_XPM4_ERRORS', false);
  273. }
  274.  
  275. $get_config = simplexml_load_file('engine/config_mods/smtp_settings.xml');
  276.  
  277. require("engine/mail.php");
  278. $m = new MAIL;
  279. $m->From($core['config']['master_mail']);
  280. $m->AddTo(trim($email));
  281. $m->Subject('Contact Us - '.$subject_set.'');
  282. $m->Html($body);
  283.  
  284. if($get_config->smtp_connection == 'none'){
  285. $c = $m->Connect(trim($get_config->smtp_server), intval($get_config->smtp_port), trim($get_config->smtp_username), trim($get_config->smtp_password)) or $smtp_connect_fail = '1';
  286. }else {
  287. $c = $m->Connect(trim($get_config->smtp_server), intval($get_config->smtp_port), trim($get_config->smtp_username), trim($get_config->smtp_password), trim($get_config->smtp_connection), 10, 'localhost', null, 'plain') or $smtp_connect_fail = '1';
  288. }
  289. if($smtp_connect_fail != '1'){
  290. if($m->Send($c)){
  291. $msg_error = msg('1',str_replace("{userid}",$userid,text_register_success2));
  292. }else{
  293. echo msg('0',text_register_error13);
  294. }
  295. }else {
  296. echo msg('0',text_register_error14);
  297. }
  298.  
  299.  
  300. }
  301. }else{
  302. $msg_error = msg('0',text_register_error15);
  303. }
  304. }
  305. }
  306. }
  307. }
  308. }
  309.  
  310. if($register_method == '2'){
  311. if(isset($_GET['activation_id'])){
  312. $activate_md5 = '1';
  313. if(empty($_GET['activation_id'])){
  314. header('Location: '.ROOT_INDEX.'');
  315. }else{
  316. $md5_link = safe_input($_GET['activation_id'],'');
  317. $check_link = $core_db2->Execute("Select confirmed,memb___id from MEMB_INFO where activation_id=?",array($md5_link));
  318. if($check_link->EOF){
  319. $msg_error = msg('0',text_register_error16);
  320. }else{
  321. if($check_link->fields[0] == '1'){
  322. $msg_error = msg('0',text_register_error17);
  323. }elseif ($check_link->fields[0] == '0'){
  324. $active_id = $core_db2->Execute("Update MEMB_INFO set bloc_code='0',confirmed='1' where activation_id=?",array($md5_link));
  325. if($active_id){
  326. $msg_error = msg('1',str_replace("{userid}",$check_link->fields[1],text_register_success3));
  327. }else {
  328. $msg_error = msg('0',text_register_error18);
  329. }
  330.  
  331. }
  332. }
  333. }
  334. }
  335.  
  336. echo ' <table  border="0" cellspacing="4" cellpadding="0"  align="center" width="100%" >
  337. <tr>';
  338. if($activate_md5 != 1){
  339. echo '<td align="left" class="curent_step" width="33%">1. '.text_register_complete_form.'</td>';
  340. }else{
  341. echo '<td align="left" class="step" width="33%">1. '.text_register_complete_form.'</td>';
  342. }
  343. if($activate_md5 == '1'){
  344. echo '<td align="left" class="curent_step"  width="33%">2. '.text_register_activate_account.'</td>';
  345. }else {
  346. echo '<td align="left" class="step"  width="33%">2. '.text_register_activate_account.'</td>';
  347. }
  348. echo '
  349. </tr>
  350. </table>';
  351.  
  352.  
  353.  
  354. }
  355. if($msg_error){
  356. echo $msg_error;
  357. }
  358. if($activate_md5 != '1'){
  359.  
  360. if($complete != '1'){
  361. $userid_post = htmlspecialchars($_POST['userid']);
  362. $p_id_post = htmlspecialchars($_POST['pers_id']);
  363. $email_post = htmlspecialchars($_POST['email_address']);
  364. $country_post = htmlspecialchars($_POST['country']);
  365. $question_post = htmlspecialchars($_POST['question']);
  366. $anaswer_post = htmlspecialchars($_POST['answer']);
  367. }
  368. echo '
  369. <form name="sign_up_frm" method="post" action="" id="sign_up_frm">
  370. <div id="a"></div>
  371. <table border="0" cellspacing="10" cellpadding="0" width="100%" style="margin-top: 10px;" align="center">
  372. <tr>
  373. <td colspan="3" align="left" class="iRg_line">'.text_register_t1.':</td>
  374. </tr>
  375. <tr>
  376. <td align="left" class="iRg_text" style="padding-left: 24px;" width="130">'.text_user_id.'</td>
  377. <td align="center" class="iRg_inf"><input class="iRg_input" type="text" name="userid" id="userid" maxlength="10" onclick="document.getElementById(\'c_uss\').innerHTML=\''.text_register_req1.'\'" value="'.$userid_post.'"> <a href="javascript:void(0)" onclick="cs_ua_a();">'.link_check_available.'</a></td>
  378. <td align="left" ><span class="iRg_inf"><div id="c_uss">'.text_register_req1.'</div></span></td>
  379. </tr>
  380. </tr>
  381. <tr>
  382. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_password.'</td>
  383. <td align="left"><input class="iRg_input" type="password" name="password" id="password" maxlength="12"></td>
  384. <td align="left"><span class="iRg_inf">'.text_register_req2.'</span></td>
  385. </tr>
  386. <tr>
  387. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_cnf_password.'</td>
  388. <td align="left"><input class="iRg_input" type="password" name="confirm_password" id="confirm_password" maxlength="12"> <span class="iRg_inf"></span></td>
  389. <td align="left"><span class="iRg_inf"><em>*'.text_register_req3.'</em></span></td>
  390. </tr>
  391. </tr>';
  392. if($get_config->pers_id_active == '1'){
  393. echo '<tr>
  394. <td colspan="3" align="left" class="iRg_line">'.text_register_t2.':</td>
  395. </tr>
  396. <tr>
  397. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_personal_id.'</td>
  398. <td align="left"><input class="iRg_input" type="text" name="pers_id" id="pers_id" maxlength="'.$get_config->pers_id_length.'" value="'.$p_id_post.'"> <span class="iRg_inf"></span></td>
  399. <td align="left"><span class="iRg_inf"><span class="iRg_inf">'.text_register_req4.'</span></td>
  400. </tr>
  401. </tr>
  402. ';
  403. }
  404.  
  405. echo '
  406. <tr>
  407. <td colspan="3" align="left" class="iRg_line">'.text_register_t3.':</td>
  408. </tr>
  409. <tr>
  410. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_email_address.'</td>
  411. <td align="center" class="iRg_inf"><input class="iRg_input" maxlength="50" type="text" name="email_address" id="email_address" onclick="document.getElementById(\'c_mss\').innerHTML=\''.text_register_req5.'\'" value="'.$email_post.'"> <a href="javascript:void(0)" onclick="csm_uam_am();">'.link_check_available.'</a></td>
  412. <td align="left"><span class="iRg_inf"><div id="c_mss">'.text_register_req5.'</div></span></td>
  413. </tr>
  414. <tr>
  415. <td colspan="3" align="left" class="iRg_line">'.text_register_t4.':</td>
  416. </tr>
  417. <tr>
  418. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_country.'</td>
  419. <td align="left"><select name="country" class="iRg_input" id="country"><option value="x">--'.text_select.'</option>';
  420.  
  421.    $c = getcountry('list');
  422. foreach ($c as $cc => $v) {
  423. if($country_post == $cc){
  424. echo  '<option value="'.$cc.'" selected="selected">'.$v.'</option>';
  425. }else{
  426. echo  '<option value="'.$cc.'">'.$v.'</option>';
  427. }
  428.  
  429. }
  430.  
  431. echo '</select></td>
  432. <td align="left"></td>
  433. </tr>
  434. <tr>
  435. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_gender.'</td>
  436. <td align="left" class="iRg_gender"><label><input name="gender" id="gender" type="radio" value="1">'.text_male.'</label>&nbsp;&nbsp;&nbsp;<label><input name="gender" type="radio" value="2" id="gender">'.text_female.'</label></td>
  437. <td align="left"></td>
  438. </tr>
  439. <tr>
  440. <td colspan="3" align="left" class="iRg_line">'.text_register_t5.':</td>
  441. </tr>
  442. <tr>
  443. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_register_secret_question.'</td>
  444. <td align="left" colspan="2"><select name="question" id="question"  class="iRg_input"><option value="x">--'.text_select.'</option>
  445. ';
  446.    foreach ($secret_questions as $sq_id => $sq_name){
  447.     if($question_post == $sq_id){
  448.     echo '<option value="'.$sq_id.'" selected="selected">'.$sq_name.'</option>';
  449.     }else{
  450.     echo '<option value="'.$sq_id.'">'.$sq_name.'</option>';
  451.     }
  452.  
  453.  
  454.  
  455. }
  456.   echo '</select></td>
  457. <td align="left"></td>
  458. </tr>
  459. <tr>
  460. <td align="left" class="iRg_text"  style="padding-left: 24px;">'.text_register_answer_question.'</td>
  461. <td align="left" colspan="2"><input class="iRg_input" type="text" name="answer" id="answer" maxlength="20" value="'.$anaswer_post.'">&nbsp;&nbsp;&nbsp;'.text_register_req6.'</td>
  462. </tr>
  463. </tr>
  464. <tr>
  465. <td colspan="3" align="left" class="iRg_line">'.text_register_t6.':</td>
  466. </tr>
  467. <tr>
  468. <td align="left" colspan="3"> ';
  469.   if($is_reCAPTCHA == '1'){
  470.   $publickey = $verification_config->reCAPTCHA_public_key;
  471.   echo '<script type="text/javascript">
  472. var RecaptchaOptions = {
  473. theme : \''.$verification_config->reCAPTCHA_theme.'\'
  474. ,lang : \'en\'
  475. };
  476. </script>
  477. ';
  478.   echo recaptcha_get_html($publickey);
  479.  
  480.   }else{
  481.   echo '
  482. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  483. <tr>
  484. <td align="left"><img src="get.php?aI" border="0"></td>
  485. <td align="left" class="iRg_inf"><div align="left" style="padding-bottom: 4px; ">'.text_register_type_code.'</div><input class="iRg_input" type="text" name="verify_int" id="verify_int"></td>
  486. </tr>
  487. </table>'
  488. ;
  489.   }
  490.  echo '
  491. </td>
  492. </tr>
  493. </table>
  494.  
  495. <table border="0" cellspacing="10" cellpadding="0" width="100%"  align="center">
  496. <tr>
  497. <td align="center" colspan="2" class="iRg_terms_agree"><label><input type="checkbox" name="terms" value="1"> '.text_register_read_terms1.'</label> <a href="'.ROOT_INDEX.'?'.LOAD_GET_PAGE.'='.TERMSOFSERVICE_CMS_PAGE.'" target="_blank">'.text_register_read_terms2.'</a>.<input type="hidden" name="create_account"></td>
  498. </tr>
  499. <tr>
  500. <td align="right"><input type="image" src="template/'.$core['config']['template'] .'/images/submit_btn.gif" onclick="return parse_inputs()"></td>
  501. <td align="left"><img src="template/'.$core['config']['template'].'/images/cancel_btn.gif" border="0" onclick="location.href=\''.$core['config']['website_url'].'\'"></td>
  502. </table>
  503. </form>';
  504. }
  505. }
  506. ?>

Desconozco php, si puedieran guiarme un poco se los agradecería, he probado con dreamviewer pero no me da resultados, Muchas gracias, saludos
165  Programación / PHP / Problema al enviar header POST hacia una web con cURL en: 5 Marzo 2012, 09:49 am
Hola a todos, bueno tengo el siguiente problema me gustaría poder enviar un header POST con tal como lo muestra la siguiente imagen:



Esto lo capturé entrando a:
www.xtremetop100.com/in.php?site=1132331256

luego introduciendo el captcha que me pide y presionando el botón.

Me gustaría poder hacer esto automáticamente con la librerìa cURL he probado de la siguiente manera pero no logro que funcione:

Código
  1. <?php
  2. $url = 'www.google.com';
  3. $data = 'site=1132331256&word=retine&submit=Vote+for+Mu+Caos';
  4.  
  5. //cUrl//
  6. $handler = curl_init();  
  7. curl_setopt($handler, CURLOPT_URL, $url);  
  8. curl_setopt($handler, CURLOPT_POST,true);  
  9. curl_setopt($handler, CURLOPT_POSTFIELDS, $data);  
  10. curl_exec ($handler);  
  11. curl_close($handler);
  12. //cUrl
  13. ?>

Ya que cuando lo hago desde el navegador me debería redireccionar al index.php (www.xtremetop100.com)

Espero una respuesta, muchas gracias, Saludos

EDIT: me olvidaba word= contiene el captcha no quise colocar el código completo, pero el captcha lo tomo desde la siguiente web:

http://www.xtremetop100.com/captchasystem/captcha.php

No quiero saltarme el captcha
166  Foros Generales / Sugerencias y dudas sobre el Foro / ¿Qué pasó con la descripción de ingeniería inversa? en: 4 Marzo 2012, 16:11 pm
Pues eso, me gustaría saber en que quedó si valió la pena las peticiones por parte de algunos usuarios de ese subforo junto con el moderador de el, Saludos
167  Programación / PHP / Problema con PHP (librería curl) en: 4 Marzo 2012, 01:47 am
Hola a todos tengo un modulo para mi web que tiene como propósito lo siguiente: El usuario debe introducir alguno de sus datos, además de eso deberá introducir en un textbox una captcha, esta captcha es externa a mi servidor y es sacada desde un sistema de votación. La idea es que a través del módulo ocurra lo siguiente:
Citar
-el usuario introduce su ID de login
-el usuario introduce su Personaje
-el usuario introduce el captcha (este tomado desde un servidor externo de votaciones)

La idea es que cuando el usuario presione el botón enviar, a través de la librería curl se envíe una cabecera http header post al servidor externo para validar el voto en la página externa.

Todo funciona a la perfección excepto la cabecera post que no se envía:

la imagen del formulario es la siguiente:



en donde el captcha es tomado desde la página:
http://www.xtremetop100.com/in.php?site=1132331256



En otras palabras que automáticamente se valide el voto de la página http://www.xtremetop100.com/in.php?site=1132331256

He utilizado Live Http Headers para visualizar como trabaja el sistema de votos en el servidor externo. a continuación muestro una imagen de como trabaja.



Por lo que deduzco que debería enviar el contenido post mostrado en la imagen.

Pero no funciona, adjunto vote.php para ver en que falla:


Código
  1. <?php
  2. include("secure.php");
  3. include("config.php");
  4.  
  5. //Configurar votacion
  6. $votehours = "12";
  7. $votecredits = "10";
  8. $votelink = "http://www.mu-caos.cl";
  9.  
  10. // Obtiene imagen captcha
  11. $img = 'http://www.xtremetop100.com/captchasystem/captcha.php';
  12.  
  13.  
  14. $connect = mssql_connect($core['db_host'],$core['db_user'],$core['db_password']);
  15. $db = mssql_select_db($core['db_name'],$connect);
  16. if(!$db) die('<center>Conexion SQL fallida!</center>');
  17.  
  18. function vote()
  19. {
  20. global $votecredits;
  21. global $votelink;
  22. global $votehours;
  23.  
  24. $captcha_valude = secure($_POST['captcha_valude']);
  25. $character = secure($_POST['character']);
  26. $account = secure($_POST['login']);
  27. $data ='site=1132331256&word='.$_POST['captcha_valude'].'&submit=Vote+for+Mu+Caos';
  28. check_inject();
  29.  
  30. $time = 60 * 60 * $votehours;
  31. $timenow = time();
  32. $time2 = $timenow - $time;
  33.  
  34. $queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
  35. $accountcheck = mssql_num_rows($queryaccount);
  36.  
  37. $querycharacter = mssql_query("Select * from Character where Name='$character'");
  38. $charactercheck = mssql_num_rows($querycharacter);
  39.  
  40. $queryvote = mssql_query("Select * from votereward where time>'$time2' and memb___id='$account'");
  41. $votecheck = mssql_num_rows($queryvote);
  42.  
  43. if(empty($account)) { echo"<font color='red'>Introduce tu ID!</font><br>"; $error=1; }
  44. elseif(empty($character)) { echo"<font color='red'>Introduce tu personaje!</font><br>"; $error=1; }
  45. elseif(empty($captcha_valude)) { echo"<font color='red'>Introduce las letras de la imagen!</font><br>"; $error=1; }
  46. elseif($accountcheck <= 0) { echo"<font color='red'>La ID ingresada no existe!</font><br>"; $error=1; }
  47. elseif($charactercheck <= 0) { echo"<font color='red'>El personaje introducido no existe!</font><br>"; $error=1; }
  48. elseif($votecheck >= 1) { echo"<font color='red'>Votaciones permitidas solo cada $votehours horas!</font><br>"; $error=1; }
  49.  
  50. if($error != 1) {
  51. $a = mssql_query("INSERT INTO votereward (memb___id, time ) VALUES('$account','$timenow')");
  52. $b = mssql_query("Update Character set PCPoints = PCPoints+$votecredits WHERE Name='$character'");
  53.  
  54. // PRUEBA
  55. $ch = curl_init('http://www.xtremetop100.com/in.php?site=1132331256');
  56. curl_setopt ($ch, CURLOPT_POST, 1);
  57. curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
  58. curl_exec ($ch);
  59. curl_close ($ch);
  60.  
  61.  
  62. // PRUEBA
  63. echo"<font color='green'>Votación realizada exitosamente!</font>";
  64. echo"<meta http-equiv=\"refresh\" content=\"5;url=$votelink\" />";
  65. }
  66. }
  67.  
  68. if(isset($_POST['submit'])) { vote(); }
  69. ?>
  70. <br>Por cada voto recibiras <?php echo($votecredits);?> PCPoints!
  71. <table border=0 cellspacing=5 cellpadding=0>
  72. <td width='250'>
  73. <form name="" method="post" action="">
  74. <table width="100%" border="0" cellspacing="1" cellpadding="1">
  75. <tr>
  76.  <td width="70" height="28" align="center">Login ID:</td>
  77.  <td>&nbsp;</td>
  78.  <td><p>
  79.    <input name="login" type="text" id="login" maxlength="10" />
  80.  </p></td>
  81. </tr>
  82. <tr>
  83.  <td height="20" align="center">Personaje:</td>
  84.  <td>&nbsp;</td>
  85.  <td><input name="character" type="text" id="character" maxlength="10" /></td>
  86. </tr>
  87. <tr>
  88. <td>
  89. <td align="center">
  90. <td align="left"><div>
  91.  
  92. <?php echo '<IMG src="'.$img.'">';?>
  93. <p>Inserta las letras de la imagen:</p>
  94. <p><input type="text" id="captcha_valude" name="captcha_valude"></p>
  95.  <input type="submit" class=button name="submit" value="Votar" />
  96.  <input type="reset" class=button name="reset" value="Resetear" />
  97. </div>
  98. <td>&nbsp;</td>
  99. </tr>
  100. </table>
  101. </form>
  102. </div>
  103. </td>
  104. </table>

Desconozco de PHP, todo lo he encontrado indagando por Internet y con un poco de ayuda de yoya que me ha dado unas pequeñas pistas.

Yo creo que el fallo dentro del recuadro de comentario // prueba

Si me dijeran que debería agregar o modificar o en que estoy fallando se los agradecería mucho, es lo único que me falta para un proyecto que llevo realizando desde hace una buena cantidad de tiempo. Muchísimas gracias por leer

Saludos
168  Programación / PHP / Problema con formulario de registro en: 25 Febrero 2012, 03:08 am
Hola a todos, bueno les comento tengo un formulario prediseñado en mi página web para registrarse, se podría decir que funciona correctamente, pero tengo un pequeño problema en cuanto al registro de la web, al verificar si la ID o Mail existen, un script se encarga de esto y funciona bien pero es muy inestable, el script lo logré hacer funcionar gracias a EFEX, si el script no funciona me muestra un mensaje que dice failed me gustaría como hacer para que en ves de mostrarme el el mensaje failed lo vuelva a intentar. Desconozco de PHP, por eso acudo a su ayuda.


Adjunto un estracto de Register.php

Código
  1. <?
  2.  
  3. $get_config = simplexml_load_file('engine/config_mods/register_settings.xml');
  4. if($get_config->active == '0'){
  5. echo msg('0',text_sorry_feature_disabled);
  6. }else{
  7. $register_method = $get_config->method;
  8.  
  9. $verification_config = simplexml_load_file('engine/config_mods/human_verification.xml');
  10. if($verification_config->human_verification_type == 'reCAPTCHA'){
  11. $is_reCAPTCHA = '1';
  12. require_once('engine/recaptchalib.php');
  13. $privatekey = $verification_config->reCAPTCHA_private_key;
  14. $resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);
  15. }
  16.  
  17.  
  18.  
  19. echo '
  20. <script type="text/javascript">    
  21. load_image= new Image(16,16);
  22. load_image.src="template/'.$core['config']['template'].'/images/load.gif";
  23.  
  24. function Ajax(div,id, page, form, append, data){
  25.  
  26.    document.getElementById(div).innerHTML = \'<img src="template/'.$core['config']['template'].'/images/load.gif" width="16" height="16"> Please wait...\';
  27. var veri = \'\';
  28. if( typeof(data) == "string")
  29. veri = data;
  30. else
  31. veri = $(form).serialize();
  32. $.ajax({
  33.   type: "POST",
  34.   url: page,
  35.   data: veri,
  36.   error: function(html)
  37.   {
  38. <--------------------Aquí está el señor problema :B-------------------->
  39.   alert("falied");
  40.   },
  41.   success: function(html)
  42.   {
  43.     if( typeof(append) == "boolean")
  44. $(id).append(html);
  45. else
  46. $(id).html(html);
  47.   }
  48.  });
  49.  return false;
  50. }
  51. </script>
  52.  
  53. <script type="text/javascript">
  54. function cs_ua_a(){
  55. if (document.sign_up_frm.userid.value.length < 4){
  56. alert(\'User ID, 4-10 characters\n(letters and numbers only)\');
  57. }else{
  58. uss = document.getElementById(\'userid\').value;
  59. url_p = "get.php?aA="+uss;
  60. Ajax(\'c_uss\',\'#c_uss\',url_p, null, \'data=c_uss\');
  61. }
  62.  
  63. }
  64.  
  65. function csm_uam_am(){
  66. if (document.sign_up_frm.email_address.value.length < 2){
  67. alert(\'Please enter an valid mail address \n(e.g: somebody@yahoo.com)\');
  68. }else{
  69. uss = document.getElementById(\'email_address\').value;
  70. url_p = "get.php?aMl="+uss;
  71. Ajax(\'c_mss\',\'#c_mss\',url_p, null, \'data=c_mss\');
  72. }
  73.  
  74. }
  75.  
  76. function parse_inputs(){
  77. if (document.sign_up_frm.userid.value.length < 4){
  78. alert(\'User ID, 4-12 characters\n(letters and numbers only)\');
  79. return false;
  80. }
  81.  
  82. if (document.sign_up_frm.password.value.length < 6){
  83. alert(\'Password, 6-12 characters\n(letters and numbers only, passwords are case-sensitive.)\');
  84. return false;
  85. }
  86.  
  87. if (document.sign_up_frm.confirm_password.value.length < 6){
  88. alert(\'Confirm Password, 6-12 characters\n(letters and numbers only, passwords are case-sensitive.)\');
  89. return false;
  90. }
  91. if (document.sign_up_frm.password.value != document.sign_up_frm.confirm_password.value){
  92. alert(\'Passwords did not match.\');
  93. return false;
  94. }
  95. ';
  96. if($get_config->pers_id_active == '1'){
  97. echo 'if (document.sign_up_frm.pers_id.value.length < '.$get_config->pers_id_length.'){
  98. alert(\'Please enter an valid Personal ID number \n(12 digits, numbers

Muchas gracias, Saludos

PD:Si tienen duda con el registro, adjunto la página para que corroboren:

http://mu-caos.cl/index.php?page_id=register
169  Programación / Desarrollo Web / Problema se queda cargando el chat y otras cosas en: 20 Febrero 2012, 17:46 pm
Hola a todos, aquí nuevamente para los que me conocen y me han brindado su ayuda. Para los que no les comento que estoy haciendo un servidor de juego y he montado una web

Citar
Me han ayudado a colocar un link a una imagen, a utilizar ?id= y que me mostrara un mensaje de texto.

Ahora tengo un problema muy difícil y analizando la web creo que es el único, creo que de alguna u otra manera tiene solución pero lamentablemente creo que es algo muy puntual que no está al alcance de mis conocimientos (desconozco de PHP).

Les comento el problema:
Ya montada la web prediseñada y posteriormente instalada. Todo funciona bien, incluyendo CHAT, Verificar si ID está disponible, Verificar si mail está disponible.

Pero al momento de cambiar el tema o skin funciona todo a la perfección excepto lo comentado con rojo queda pegado en loading (un .gif) y no muestra ningún resultado, por lo que creo que es alguna falla del SKIN. ya que si vuelvo nuevamente a elegir el tema que viene por defecto, funciona sin ningún problema.

Les dejo la web del chat para que visualicen el error:

http://mu-caos.cl/index.php?page_id=chat

el de register (verificar disponibilidad ID, Mail)
http://www.mu-caos.cl/index.php?page_id=register

170  Programación / Bases de Datos / Incrementar datos de una columna en: 15 Febrero 2012, 22:30 pm
Hola a todos bueno tengo las siguientes columnas:

|ID|nombre|
1     juan
2     esteban
3     alfonso
4     felipe

como podría hacer para que ID aumente de +1 cada vez que se introduscan datos en una fila es decir que si introduzco un nombre después de felipe ID quede con 5?, Muchas gracias Saludos
Páginas: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 ... 39
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines