Jump to content

Pawn

Members
  • Posts

    126
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://brickmedialab.com

Profile Information

  • Gender
    Male
  • Location
    England

Pawn's Achievements

Member

Member (2/5)

0

Reputation

  1. I've written an extremely minimal landing page that animates the position of text links within a paragraph to form a simple navigation bar. You can see it at brickmedialab.com. Unfortunately, for everyone not running Firefox that page will look horrible. Because of my inexperience with jQuery, I absolutely positioned my text links so they could be easily moved with a click(). Because browsers render text so differently, this results in some very broken text positioning in anything but Firefox. Further, text-size is animated as part of the transition, which again looks great in FF, but terrible in WebKit browsers and (I assume) IE. Here's what's going on at the moment: $(function() { $('a').attr('onclick', 'return false').attr('href', '#'); $('a').click(function() { var go = $(this).attr('id'); $(this).css('color', '#404040'); $(this).blur(); $('p, h1').fadeTo(1200, '0', function() { $('#work').animate({ bottom: '540px', left: '0px', fontSize: '1.5em', fontStyle: 'normal' }, 1400); $('#about').animate({ bottom: '540px', left: '20px', fontSize: '1.5em', fontStyle: 'normal' }, 1400); $('#hello').animate({ bottom: '540px', left: '40px', fontSize: '1.5em', fontStyle: 'normal' }, 1400, function() { window.location = go; }); $('h1').fadeTo('slow', '0', function() { }) }); }); }); I'd really appreciate any thoughts on resolving these issues. When it comes to Javascript, I'm totally at sea.
  2. Thanks! Close, but no cigar. There's a test page here if it's any use.
  3. The goal is to interpret user search submissions like the following in an intelligent way. "oscar wilde 1903-1910 £4-10" Ideally after pattern matching such a query the script would have variables like $price_min, $price_max, $year_min, $year_max and $query_clean to work with. With these we could construct really useful SQL. All I've got for my efforts over the last couple of hours has been a headache. Can anyone help? Pseudo-code: $q = $_GET['query'] $price_range_expr = some_regex $year_range_expr = some_more_regex if $price_range = match all $price_range_expr in $q $q = strip $price_range from $q $price_min = $price_range[1] $price_max = $price_range[2] endif if $year_range = match all $year_range_expr in $q $q = strip $year_range from $q $price_min = $year_range[1] $price_max = $year_range[2] endif
  4. You are missing a semi colon after return $rss_datal.
  5. Then your form action is setting the querystring. Use <form action="<?=$_SERVER['REQUEST_URL']?>"> or similar. The querystring won't persist unless it's actually embedded in links.
  6. By refreshing the page, do you mean by pressing refresh, or following a link on the page to itself? Do you need the value of the $_GET variable to still be accessible? Why do you actually want to do this?
  7. Aways check the result of mysql_query. The more verbose your error handling, the easier you will find it to debug your code. $sql = "SELECT col FROM tbl_name"; if(!$query = mysql_query($sql)) { echo "An error occured on line ".__LINE__.".<br />\n" . "MySQL said: ".mysql_error().".<br /><br />\n" . "Query: ".$sql; exit; } $num_rows = mysql_num_rows($query); if($num_rows == 0) { echo "No results were returned.<br /><br />\n" . "Query: ".$sql; }
  8. Sorry, my bad. $months = array(); while($row = mysql_fetch_row($result)) { $months[] = $row[0]; } print_r($months); Or what PFMaBiSmAd said.
  9. $months = array(); while($row = mysql_fetch_assoc($result)) { $months[] = $row[0]; } print_r($months);
  10. Pawn

    Logout

    Reset the cookie on every page load.
  11. if(isset($_POST['Submit'])) { $to = 'blabla@gmail.com'; $subject = 'Bericht ontvangen van'.$fromsubject.' Actie Pagina'; $body = ''; unset($_POST['Submit']); foreach($_POST as $key => $val) { $body .= ucfirst($key).": ".$val."\n"; } if(mail($to, $subject, $body)) { echo "Mail sent to ".$to." successfully."; } else { echo "Mail could not be sent."; } }
  12. <?php $sql = "SELECT qid,question,oc1 FROM tblquestions WHERE qid = 1"; if(!$query = mysql_query($sql)) { echo mysql_error(); exit; } $row = mysql_fetch_assoc($query); ?> <input type="hidden" name="oc1" value="<?=$row['oc1']?>" />
  13. Pawn

    Order By Subquery

    Bingo! Nicely done.
  14. That code generates a fatal parse error. Set your scripts to report errors during development! You're not closing the foreach loop. foreach($columns as $col){ if($_POST[$col] != ""){ $where.= "$col = '$_POST[$col]' AND "; } }
×
×
  • 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.