Jump to content

advancedfuture

Members
  • Posts

    132
  • Joined

  • Last visited

    Never

Everything posted by advancedfuture

  1. So I am programming a lead generation site. All my leads come in from a form and the info is dumped into a database. Now I have several vendors signed up on the site, and what I want to do, is to have each lead go to 2 vendors. That is easy, I can do that no problem. This is what I am trying to tackle and I dont know exactly how I should go about this in PHP. I have more than 2 vendors, right now I have about 26, and I want the leads to be spread out amongst the vendors evenly as they come in. How can I do this so it doesnt always just go to the same vendors? Your thoughts are appreciated
  2. well thank you very much for all your help it is greatly appreciated
  3. Corbin! Thanks a million that worked! I'm back in! Any idea as to why it would have locked me out all of the sudden?
  4. I am logged in locally through SSH. and also too the website is hosted locally on the server, using the same login credentials and works fine.
  5. So I setup a database in mysql, everything runs no problems, and the web application is connecting and pulling from the database no problem. Now I SSH into my server today because I want to setup a new database. root@air629# mysql -USER root -p Enter Password: ******** Error 2002 (HY000): Can't Connect to local MySQL server through socket 'ER' (2) root@air629# mysql Error 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) OKAY! This is bizzare.. my web app connects to the database using root login and it works no problems, yet I can login through the command prompt. It was working no problems 2 days ago the last time I logged in. Any ideas whats wrong, and what I can do to regain access to my databases? ERROR 1045 (28000):
  6. okay so I know for a FACT that mod_rewrite is working, cuz I just used it to do URL redirection for another domain hosted on my server and that worked fine. So its something to do with writing SEF urls.
  7. Below is a copy of my httpd.conf file. Now I tried adding "LoadModule rewrite_module modules/mod_rewrite.so" in the file, but when I do and restart apache it tells me that the module is already loaded by default. So I am a bit lost. The directory where my actual files are residing is /usr/local/apache/htdocs Include "/usr/local/apache/conf/includes/pre_main_global.conf" Include "/usr/local/apache/conf/includes/pre_main_2.conf" LoadModule auth_passthrough_module modules/mod_auth_passthrough.so LoadModule bwlimited_module modules/mod_bwlimited.so Include "/usr/local/apache/conf/php.conf" Include "/usr/local/apache/conf/includes/errordocument.conf" KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 UseCanonicalName Off AccessFileName .htaccess DefaultType text/plain HostnameLookups Off ErrorLog logs/error_log ServerTokens Full AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/usr/local/apache/manual$1" LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW ForceLanguagePriority Prefer AddType text/html .shtml ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi Alias /icons/ /usr/local/apache/icons/ Alias /bandwidth/ /usr/local/bandmin/htdocs/ Alias /sys_cpanel/ /usr/local/cpanel/sys_cpanel/ Alias /java-sys/ /usr/local/cpanel/java-sys/ Alias /img-sys/ /usr/local/cpanel/img-sys/ Alias /akopia/ /usr/local/cpanel/3rdparty/interchange/share/akopia/ Alias /neo-images/ /usr/local/cpanel/base/neomail/neo-images/ Alias /mailman/archives/ /usr/local/cpanel/3rdparty/mailman/archives/public/ Alias /pipermail/ /usr/local/cpanel/3rdparty/mailman/archives/public/ Alias /interchange/ /usr/local/cpanel/3rdparty/interchange/share/interchange/ Alias /interchange-5/ /usr/local/cpanel/3rdparty/interchange/share/interchange-5/ ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" ScriptAlias /cgi-sys/ /usr/local/cpanel/cgi-sys/ ScriptAlias /mailman/ /usr/local/cpanel/3rdparty/mailman/cgi-bin/ ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap <IfModule prefork.c> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <Directory "/"> Options All AllowOverride All </Directory> <Directory "/usr/local/apache/htdocs"> Options Includes Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Files ~ "^error_log$"> Order allow,deny Deny from all Satisfy All </Files> <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch> <IfModule mod_mime.c> TypesConfig conf/mime.types AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw AddCharset ISO-8859-1 .iso8859-1 .latin1 AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen AddCharset ISO-8859-3 .iso8859-3 .latin3 AddCharset ISO-8859-4 .iso8859-4 .latin4 AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk AddCharset ISO-2022-JP .iso2022-jp .jis AddCharset ISO-2022-KR .iso2022-kr .kis AddCharset ISO-2022-CN .iso2022-cn .cis AddCharset Big5 .Big5 .big5 AddCharset WINDOWS-1251 .cp-1251 .win-1251 AddCharset CP866 .cp866 AddCharset KOI8-r .koi8-r .koi8-ru AddCharset KOI8-ru .koi8-uk .ua AddCharset ISO-10646-UCS-2 .ucs2 AddCharset ISO-10646-UCS-4 .ucs4 AddCharset UTF-8 .utf8 AddCharset GB2312 .gb2312 .gb AddCharset utf-7 .utf7 AddCharset utf-8 .utf8 AddCharset big5 .big5 .b5 AddCharset EUC-TW .euc-tw AddCharset EUC-JP .euc-jp AddCharset EUC-KR .euc-kr AddCharset shift_jis .sjis AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddHandler type-map var </IfModule> <IfModule mod_log_config.c> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog logs/access_log common </IfModule> <Directory "/usr/local/apache/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory "/usr/local/apache/manual"> Options Indexes AllowOverride None Order allow,deny Allow from all SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1 RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2 <Files ~ "^error_log$"> Order allow,deny Deny from all Satisfy All </Files> <Files *.html> SetHandler type-map </Files> </Directory> <Directory "/usr/local/apache/htdocs"> Options Indexes FollowSymLinks MultiViews AllowOverride All <Files ~ "^\.ht"> Satisfy All </Files> </Directory> <Directory "/usr/local/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> <IfModule mod_autoindex.c> IndexOptions FancyIndexing VersionSort AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t </IfModule> <IfModule mod_setenvif.c> BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully BrowserMatch "^gnome-vfs" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully </IfModule> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the # # configuration file. To have modifications retained, all modifications must be checked into the # # configuration system by running: # # /usr/local/cpanel/bin/apache_conf_distiller --update # # To see if your changes will be conserved, regenerate the Apache configuration file by running: # # /usr/local/cpanel/bin/build_apache_conf # # and check the configuration file for your alterations. If your changes have been ignored, then they will # # need to be added directly to their respective template files. # # # # It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf # # For detailed instructions on using Include files and the apache_conf_distiller with the new configuration # # system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html # # # # This configuration file was built from the following templates: # # /var/cpanel/templates/apache2/main.default # # /var/cpanel/templates/apache2/main.local # # /var/cpanel/templates/apache2/vhost.default # # /var/cpanel/templates/apache2/vhost.local # # /var/cpanel/templates/apache2/ssl_vhost.default # # /var/cpanel/templates/apache2/ssl_vhost.local # # # # Templates with the '.local' extension will be preferred over templates with the '.default' extension. # # The only template updated by the apache_conf_distiller is main.default. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # PidFile logs/httpd.pid LockFile logs/accept.lock # Defined in /var/cpanel/cpanel.config: apache_port Listen 0.0.0.0:80 Timeout 300 User nobody Group nobody ExtendedStatus On ServerAdmin info@lm-tek.com ServerName air629.startdedicated.com LogLevel warn ServerSignature On RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect RewriteLock /usr/local/apache/logs/rewrite_lock UserDir public_html # DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html SSLPassPhraseDialog builtin SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache SSLSessionCacheTimeout 300 SSLMutex file:/usr/local/apache/logs/ssl_mutex SSLRandomSeed startup builtin SSLRandomSeed connect builtin <IfDefine SSL> # Defined in /var/cpanel/cpanel.config: apache_ssl_port Listen 0.0.0.0:443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl </IfDefine> AddHandler cgi-script .cgi .pl .plx .ppl .perl AddHandler server-parsed .shtml AddType text/html .shtml AddType application/x-tar .tgz AddType text/vnd.wap.wml .wml AddType image/vnd.wap.wbmp .wbmp AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlc .wmlc AddType application/vnd.wap.wmlscriptc .wmlsc <Location /whm-server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> # SUEXEC is supported Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf" Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf" # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. NameVirtualHost 69.64.38.19:80 NameVirtualHost * # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. <VirtualHost 69.64.38.19:80> ServerName air629.startdedicated.com DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com </VirtualHost> # Default vhost for unbound IPs <VirtualHost *> ServerName air629.startdedicated.com DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com </VirtualHost> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. <VirtualHost 69.64.38.19:80> ServerName hostlily.com ServerAlias www.hostlily.com DocumentRoot /home/hostlily/public_html ServerAdmin webmaster@hostlily.com UseCanonicalName Off CustomLog /usr/local/apache/domlogs/hostlily.com combined CustomLog /usr/local/apache/domlogs/hostlily.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User hostlily # Needed for Cpanel::ApacheConf <IfModule !mod_disable_suexec.c> SuexecUserGroup hostlily hostlily </IfModule> ScriptAlias /cgi-bin/ /home/hostlily/public_html/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/hostlily/hostlily.com/*.conf" </VirtualHost> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. # SSL <IfDefine SSL> </IfDefine> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. # CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS <VirtualHost 69.64.38.19:80 *> ServerName air629.startdedicated.com ServerAlias cpanel.* whm.* webmail.* webdisk.* DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com RewriteEngine On RewriteCond %{HTTP_HOST} ^cpanel\. RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P] RewriteCond %{HTTP_HOST} ^webmail\. RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P] RewriteCond %{HTTP_HOST} ^whm\. RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P] RewriteCond %{HTTP_HOST} ^webdisk\. RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P] UseCanonicalName Off </VirtualHost> Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf" Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"
  8. So here's the delimma I am in. I have a dedicated server through server4you. I installed PHP5 and MySQL5 on it. Okay that works no problem. The problem is I have uploaded my .htaccess file to rewrite SEF urls and it doesnt work. My question is this. Is either A.) mod_rewrite disabled somehow on the server and I need to turn it on? If so where. and B.) is my mod_rewrite file messed up? .htaccess file Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)\.html$ /states.php?&st=$1/ [L] RewriteRule ^(.*)_(.*)\.html$ /city.php?&st=$1&city=$2/ [L] RewriteRule ^(.*)_(.*)_(.*)\.html$ /services.php?&st=$1&city=$2&services=$3/ [L] RewriteBase / Any help for this confusion would be appreciated
  9. a little bit more info. ran a query on the users setup in mysql... all the existing ones @localhost are set to grantable. but the ones @'%' are set non grantable usage... hope that helps
  10. so here is what i have done now. In an effort to tackle this another way. I have a dedicated server with server4you. I setup the database there. edited the my.cnf file to listen in on the public IP of the server. added remote access for the user via command prompt via: GRANT ALL ON dialone.* TO dialone@'%' IDENTIFIED BY '******'; restarted mysql. Now i get a connection error: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/content/d/i/a/dial1auto/html/dbconnect.php on line 9 Unable to connect to database! Please try again later. I've followed the remote access tutorial to a T, so I'm a bit lost as to what i need to do to get this to work. Now if i telnet to my server ip on port 3306 it connects no problem though. so I'm not sure whats up. This my dbconnect.php file: <?PHP //Connect to Database and write the URL into the profile //Connect To Database $DBhostname='xx.xx.xx.xx'; $DBusername='dialone'; $DBpassword='xxxxxxxxxxx'; $DBdbname='dialone'; mysql_connect($DBhostname, $DBusername, $DBpassword) OR DIE ('Unable to connect to database! Please try again later.'); mysql_select_db('dialone'); ?>
  11. yeah unforunately its godaddy shared hosting and its not running on localhost. I am using the connection string they gave me in the toolbar, but who knows whats going on. Even godaddy doesnt know whats going on which is really lame. Im wondering if I can point the domain to my shared hosting account because they dont allow remote database connections unfortunately.
  12. Okay so here is the situation. I keep getting generic runaround answers from godaddy and it is extremely frustrating. So I am a web developer, and I designed a site for a customer in PHP5 and MySQL4.1 and everything was working perfect on my godaddy account. I transferred the files and database over to my clients godaddy account and the setup is exactly the same. However the database is jacked up! I have tried creating several databases all with the same problem. The query I am running against the database is SELECT DISTINCT city FROM `zip_code` WHERE state_name='$state' ORDER BY city ASC works fine on my account. However the page displays: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) The connection works no problem, or DIE is not executing on the mysql connection. To further add to the problem when I try to run that query on the database itself through phpmyadmin I get an error saying "the table does not exist"... Well thats funny, it does exist, and in fact it has 89k records in it! Why would this work no problems on my account, but on my clients account it doesnt? Godaddy support is a joke BTW, its all canned responses that dont answer your questions at all.
  13. yeah it was originally backticks, it didnt work so I changed it to single quotes with the same error
  14. So I have a test godaddy account I use for developement before I bring my client sites live. It runs PHP5.x and MySQL 4.1: On my test server I run a query: SELECT DISTINCT city FROM 'zip_code' WHERE state_name='California' ORDER BY city ASC On the test server this query runs fine. So I upload the client site to my clients godaddy hosting, created the database, the stats are exactly the same PHP5.x and MySQL 4.1 But when I try to run that query on the database I get: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''zip_code' WHERE state_name = 'California' ORDER BY city ASC LIMIT 0, 30' at line 1 IM CONFUSED AS HELL?!?! WHy would this query work on my database running the same version, and not on their database which is on the same hosting and same version? I checked and the databases are identicle.
  15. Well see thats the thing, I dont want JUST 15 records, I want them all, but I want them to be returned in a nice format rather than a mile long page of results. :-\
  16. So I am spitting out a large amount of data from my database, and I want to group it in columns that have only 15 records per column. So far I havent had much success. This is my code, what am I doing wrong? <?php $query = "SELECT DISTINCT city FROM `zip_code` WHERE state_name='$state' ORDER BY city ASC"; $results = mysql_query($query); $num = mysql_num_rows($results); echo '<table width="820" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"><tr>'; for ($counter = 1; $counter <= 15; $counter++) { echo '<td>'; while($row = mysql_fetch_array($results)) { $city = $row['city']; //GLOBAL RESUME echo '<li>'; echo '<a href="city.php?st='.$state.'&city='.$city.'">'.$city.'</a>'; echo"</li>"; } echo '</td>'; } echo '</tr></table>'; ?>
  17. I am trying to run a query on my database to delete all entries that have duplicate cities and only leave on city. But I keep getting an error: My query: DELETE FROM zip_code WHERE COUNT( city ) >1 GROUP BY city The error I keep getting: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY city' at line 1 What is wrong with my query? Any help would be much appreciated
  18. So I am using header to redirect the page from a thank you page. Now in Firefox after 3 seconds it refreshes to the new page no problem. However in IE7 it just keeps refreshing the thanks.php page and never redirects! Any idea? <?php header( "Refresh: 3; search.php" ); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Thank You!</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <br /> <table width="600" height="300" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="layout"> <tr> <td valign="middle"><div align="center"> <h1>Thank you for your submission! It has been forwarded to the us <br /> and someone will contact you within 24 hours! <br /> <br /> Try another search! </h1> </div></td> </tr> </table> </body> </html>
  19. I am trying to get this simple page to work... I know how to do it with a normal form button, but I dont know how to get the PHP code to execute when submitting a form with a javascript link. Any ideas? <SCRIPT language="JavaScript"> function submitform() { document.myform.submit(); } </SCRIPT> <form name="myform" action=""> Search: <input type='text' name='query'> <A href="javascript: submitform()">Search</A> </form> <?php if($_POST['submitform']) { echo 'this form was submitted!'; } ?>
  20. nope just curious, I was having a problem, and thought it may be it. Thank you for answering my short question, now I can more adequately diagnose the problem.
  21. Are variables declared within a while loop accessible outside of the loop?
  22. Never Mind! figured out the query all by myself yaay! SELECT * FROM businesses, zip_code WHERE businesses.businessZip = zip_code.zip_code AND 60 * 1.1515 * DEGREES(ACOS(SIN(RADIANS($cityXlat)) * SIN(RADIANS(lat)) + COS(RADIANS($cityXlat)) * COS(RADIANS(lat)) * COS(RADIANS($cityXlong-lon)))) <= 50
  23. OK so I have been developing this website in which I list businesses for sale. And I've been working on a radius search feature. my database looks as follows. I have 2 tables. First table 'businesses' Fields: businessName businessAddress businessCity businessZip Second Table I have a list of all us Cities / Zips / Lat Long Fields: id zip_code city county state_name state_prefix lat long now I've managed to use the code made by Barand do do distance calculations SELECT * FROM cities WHERE 60 * 1.1515 * DEGREES(ACOS(SIN(RADIANS($cityXlat)) * SIN(RADIANS(latitude)) + COS(RADIANS($cityXlat)) * COS(RADIANS(latitude)) * COS(RADIANS($cityXlong-longitude)))) <= 50 However, I only want to return results in the table 'businesses'. I'm assuming I have to link the tables, I was figuring by zip. But how would I construct the query to not only link the tables but only return results that exist in the table businesses within the specified range?
×
×
  • Create New...

Important Information

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.