Jump to content

n8w

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by n8w

  1. objective: I want to track outbound links using the event [b]onclick[/b] currently, I am doing using a form that goes to a script called go.php .. it looks up the id in the database and then goes .. but I would like to avoid forms so search engines can follow the links. Here is the current code note: name="user_id" is the id of the outbound link name="token" is a variable that is compared to a session variable to make sure the outbound link being counted is originating at my website [code] <form action="go.php" method="post" name="frmMyForm1297" target="_blank"> <a href="JavaScript:document.frmMyForm1297.submit();" > <img src="../../images/illustrators/1297.jpg" alt="Catherine Lepage" width="190" height="190" border="0" /><br /> <span class="headlines"><strong> Catherine Lepage</strong></span></a> <input type="hidden"  value="1297" name="user_id" > <input type="hidden"  value="b3a4156b1249469af356e6bfa0483f74" name="token" > </form> [/code] Ideally, I would like it to be like the following .. but I am not sure how to get it to work [code] <form action="go.php" method="post" name="frmMyForm1297" target="_blank"> <a href="http://www.theurl.com" onclick="outbound(1297,b3a4156b1249469af356e6bfa0483f74)"> <img src="../../images/illustrators/1297.jpg" alt="Catherine Lepage" width="190" height="190" border="0" /><br /> <span class="headlines"><strong> Catherine Lepage</strong></span></a> [/code]
  2. wow .. very cool! .. so if I want to run this every 5 minutes would it be 5 * * * * wget http://www.illustrationmundo.com -O cache.php
  3. I think what I want to do is web scrape .. but how would I write a script to do the following. I want to run a script every 30 minutes (using .htaccess I guess) that will view http://www.illustrationmundo.com and save the source exactly how a browser would see it as a file .. cached.php How do I go about this? Thanks
  4. I am pulling in content into an iframe and some of it doesn't target="_blank" in the href is there a way using javascript or something else that will force all href tags  on a page to open a new browser without modifying each href? something I can put at the top of the page in a script?
  5. I was wondering if there is a good way where I could run a cron-tab every 5 minutes to run a php script to save a php page as static html? for example .. I would like to run a script that would save http://www.illustrationmundo.com/index.php as http://www.illustrationmundo.com/index.html exactly how the php page is displayed the reason I want to do this is to reduce connections to mysql thanks n8w
  6. HEY thanks .. works like a charm!! I agree best to store as datetime .. and format later .. but does timestamp change to the current time everytime the record is modified
  7. What is the best way to get the number of days between two dates in this format? $day1=2006-07-25 $current_date=date("Y-m-d") I have tried to subtract one from another but always get 0 Also what is the best way to get the weekday of a date? $theweekday=getweekday(2006-07-25); //Thursday
  8. [!--quoteo(post=369827:date=Apr 29 2006, 04:16 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Apr 29 2006, 04:16 AM) [snapback]369827[/snapback][/div][div class=\'quotemain\'][!--quotec--] You might want to look at [a href=\"http://www.php.net/nl2br\" target=\"_blank\"]http://www.php.net/nl2br[/a] [a href=\"http://www.php.net/wordwrap\" target=\"_blank\"]http://www.php.net/wordwrap[/a] [/quote] thanks .. works awesome
  9. How can I pull data from a mysql database and preserve the white space? I was using the PRE tag but in IE even with the width specified it doesn't wrap the text so your html table ends up being way to wide Is there a php function that converts the white space save in html tags? or how should I go about accomplishing this? Thanks n8w
  10. thanks .. this works great .. just had to chage > to <
  11. Thanks Fenway .. it's not throwing errors now .. but the value is still empty I have tried putting [code] $gross_income=$row[gross_income];[/code] inside and outside of the while loop with no luck .. any ideas? [code]$gross_income=$row[gross_income]; while ($row = mysql_fetch_array($retid)) {                 $job_id=$row[job_id];                 $url_id=$row[url_id];                 $client_id=$row[client_id];                 $str_date=$row[str_date];                 $s_job_name=$row[s_job_name];                 $s_body=$row[s_bo[/code]
  12. I am having trouble figuring out the syntax for this .. or maybe the logic I have a table called [b]"client_job"[/b] and a column called [b]"dollar amount"[/b] I want to get the sum of the column "dollar_amount" with few parameters. How do I write a statement that says SELECT column_a, column_b, [b]column_c (SELECT SUM(dollar_amount) AS gross_income WHERE remittance_date > curdate())[/b] This is one of the variations I tried. [code] SELECT client_job.job_id, client_job.url_id, SELECT SUM(dollar_amount) as gross_income FROM client_job WHERE client_job.remittance_date > curdate() GROUP BY job_id, FROM client_job [/code] Thanks n8w
  13. thanks so much! .. I have some interesting results.. do you know why I get a negative number on [a href=\"http://www.illustrationmundo.com/illustrators.php\" target=\"_blank\"]http://www.illustrationmundo.com/illustrators.php[/a] but a positive number on [a href=\"http://www.illustrationmundo.com/news.php\" target=\"_blank\"]http://www.illustrationmundo.com/news.php[/a] you can see the result time on the bottom left hand corner of the page
  14. I'm trying to improve performance on my database. How do I get the time it took to execute a query you know something like searched 10000 records in .025 seconds .. thanks n8w
  15. javascript insert into textarea question can anyone tell me or point me to some information for the following: I want to create a javascript function that inserts text into the textarea of a form .. which is easy .. but how do I create it for a series of steps for example ... I want it to work just like the insert link for this editor .. where you click insert link .. it asks for the link .. then the name of the link and then inserts the code into the text area thanks n8w
  16. Hello, I have a colum in a table that is an id .. and I have a prefix of "999" on the id (I know this wasn't the best table structure .. but I am retrofitting something.) for example id 1 looks like 9991 id 2 looks like 9992 etc .. I would like to select this column but just the characters after the first "999" which would be 1,2,etc something like select id(after 3 chars) from mytable thanks n8w
  17. [!--quoteo(post=355866:date=Mar 17 2006, 04:51 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 17 2006, 04:51 AM) [snapback]355866[/snapback][/div][div class=\'quotemain\'][!--quotec--] Sounds like you need a UNION [code]SELECT article_id FROM articles  WHERE ( feature='t' AND live_date>CURDATE() ) UNION SELECT  id AS article_id FROM audio_articles WHERE ( s_front='t' and s_date>CURDATE())[/code] [/quote] Hey Barand .. you are awesome! thanks!
  18. I don't think this is a join but I'm not sure how to write it. I need help writing this sql statement I have two similar tables articles audio_articles I want to return all the records from both tables where articles - return the field (article_id) where ( feature=t and live_date>today ) audio_articles (id) AS article_id where ( s_front=t and s_date>today )
  19. I have a user registration system .. where users receive an email and have to click on the link to validate their account .. but a lot say they never received the validation email .. I think this is because my mail is getting filtered out by their server's spam filter .. is the anything I could do to prevent this? Here is what my mail to script looks like [code] $subject=$thesubject; $mail=$email_str; $maili="ocean@illustrationmundo.com"; $headers=""; $headers .= "X-Sender:  $mail <$mail>\n"; // $headers .="From: $maili <$maili>\n"; $headers .= "Reply-To: $maili <$maili>\n"; $headers .= "Date: ".date("r")."\n"; $headers .= "Message-ID: <".date("YmdHis")."selman@".$_SERVER['SERVER_NAME'].">\n"; $headers .= "Subject: $subject\n"; // subject write here $headers .= "Return-Path: $maili <$maili>\n"; $headers .= "Delivered-to: $maili <$maili>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "X-Priority: 1\n"; $headers .= "Importance: High\n"; $headers .= "X-MSMail-Priority: High\n"; $headers .= "X-Mailer: SelmanD Mailler With PHP!\n"; /* send mail */ mail($mail, $subject , $message, $headers);[/code]
  20. Hey Jasper .. great catch .. I think that was probably the problem thanks!
  21. I have been getting an error lately on my site that says too many connections are open to the database I think this is because I am not properly opening and closing my db connections .. is there anything I need to do to my code? connection script [code] <?php $usr = "username"; $pwd = "password"; $db = "database_name"; $host = "localhost"; $cid = mysql_connect($host,$usr,$pwd); if (!$cid) {    die(mysql_error()); } mysql_select_db($db,$cid) or die ("Could not open database"); ?> [/code] then when I query the database I have this [code] # execute SQL statement     $retid = mysql_db_query($db, $sql, $cid) or die(mysql_error()); # check for errors if (!$retid) { die(mysql_error());     } else { [/code] and then at the end of my page I have this [code] mysql_close(); [/code] Thanks for your help
  22. [!--quoteo(post=351744:date=Mar 4 2006, 10:51 PM:name=RuneDeath)--][div class=\'quotetop\']QUOTE(RuneDeath @ Mar 4 2006, 10:51 PM) [snapback]351744[/snapback][/div][div class=\'quotemain\'][!--quotec--] hey guys, could anyone recommend me a good php book for me to buy? im a complet begginner in php.. the only things i know in php is how to setup forums.. and make a php navigation for websites ^^ thanks [/quote] This is probably the best php book I bought PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (Paperback) by Larry Ullman starts off with really basic stuff .. but a year later you can still learn things from it.
  23. [!--quoteo(post=351659:date=Mar 4 2006, 04:15 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Mar 4 2006, 04:15 PM) [snapback]351659[/snapback][/div][div class=\'quotemain\'][!--quotec--] Consider using UTF-8 as the character set. [/quote] is that something I do with the database .. or just as a meta tag in html?
  24. I am going to create a site that will have content written in English, French, Italian and German Is there anything I need to consider for storing this information in a database? or other considerations I should be aware of?
×
×
  • 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.