
theverychap
Staff Alumni-
Posts
78 -
Joined
-
Last visited
Everything posted by theverychap
-
How to make td data spacing below if the browser need to scroll
theverychap replied to shebbycs's topic in HTML Help
CSS3 allows us to use word-wrap:break-word; -
I specifically added array and object ways, i didn't know what was in $result. Anyhow, after re-reading the question: "This way one variable holds two values - username and id. How can i assign those values to two different variables?" It would be helpful to see what is returned into $result. Maybe look at list if you want to assign values to different variables.
-
Responsive image positioned over responsive image
theverychap replied to biggieuk's topic in CSS Help
If i understand correctly, you want the ball to resize too? http://jsfiddle.net/BG8F9/ I added a percentage width to the ball, it will scale with any resizing. -
Does pricedata.VechicleName (int) contain vehicles.TableID? if so, something like SELECT pd.yourfields FROM pricedata pd LEFT JOIN vehicles v ON pd.VechicleName = v.TableID WHERE yourwhereclause... may get you on the right track.
-
Change character or wording within a url
theverychap replied to charl9cfc's topic in Apache HTTP Server
I had to create rewrite rules involving hashes recently, i made notes here: http://tizardsbriefcase.com/625/apache/apache-rewriterule-rewrite-url-to-hash -
Your foreach is wrong. <?php $query_members = "SELECT username, id FROM members LIMIT 10"; $result = $db->run($query_members); // if $result comes back as an array... foreach ($result as $user) { echo 'username: ' .$user['name'] .'<br/>'; echo 'id: ' .$user['id'] .'<br/>'; } // ...or as an object foreach ($result as $user) { echo 'username: ' .$user->name .'<br/>'; echo 'id: ' .$user->id .'<br/>'; } ?> Hope that helps.
-
Active / inactive Class with date function
theverychap replied to Joepiooo1988's topic in PHP Coding Help
How are you currently getting classes that are inactive / active - is it just a switch (on|off, 0|1 etc?). You'll need to added a "publish_date" or "activate_date" column to the table your store your data in. (Or create a table and join the two together). When creating a class, add in the publish_date to each entry. Then when pulling data from the database, make sure that the publish_date is > NOW(). Hopefully a good starting point, it's more simple than you may first imagine. -
Indeed, its valid, but older browser compatibility might be a slight issue you'll need to offer alternatives / workarounds.
-
Using SESSION variable in jquery function
theverychap replied to cliftonbazaar's topic in Javascript Help
is the JS in your PHP page? or is it in a seperate JS file? If it's in your PHP page, you could of course use: $("#autoRefreshBattingDisplay").load('borders/right.php?gameNo=<?php echo $var; ?>'); -
stoping re (post/get) requests if the page reloaded
theverychap replied to m.adel's topic in Javascript Help
Maybe take a look at tableDnD - a jQuery plugin - does exactly what you are after! And very easy to use too -
Seeing as you are using eregi - you do not need to test for lowercase AND uppercase - the i in eregi is case insensetive, and so will pick up all cases... However, eregi is depreceated, so maybe you should use preg_match, or even stristr would do: if ( stristr($_SERVER['HTTP_USER_AGENT'], 'safari') ) { header('location: http://...'); exit; }
-
Change: The reason you are getting "Please enter some text" is: You have two elements in your code with the ID of "content". So your javascript is trying to get the val() of the DIV, not the TEXTAREA. --- To stop the page flying to the top when people press "like": <a href="#" class="like" id="<?php echo $clip_id; ?>" name="down"> to: <a href="javascript:void(0);return false;" class="like" id="<?php echo $clip_id; ?>" name="down"> Hope thats helped
-
php code help need to hide a textarea after clicking a button
theverychap replied to bindiya's topic in PHP Coding Help
You should test for the $_GET'ed ID and also a $_POST['Save'], if bothg of these exist, you know which textarea to "hide" - maybe a style="display:none;" or something? -
working with documents and is php really the best choice?
theverychap replied to therob1's topic in PHP Coding Help
Set the datatype of the table colum to BLOB - you will then be able to store whatever you like Also, CKEditor is a fantastic editor! -
I can't see the problem (or do not fully understand it?) - I pasted your code into a file and loaded it using my browsers (Opera, Safari, Firefox & Chrome on the Mac) and could scroll as i assume is expected, with a static header and footer at the top and bottom...
-
If you don't have too much data yet, it would be best to restructure your database to store it in a more friendly way - this will aid the retreival of data no end! Otherwise you are into crazy uneccessary regex territory: ipreg_match_all ("/".(\\[) .'.*?' .(,) ."/is", $yourCrazyString, $m)) echo '<pre>'; print_r($m); echo '</pre>';
-
If this code is literally how you have it in your script: mysql_query($sql); $id = "ID"; $sql = "UPDATE comments SET LikeTotal = LikeTotal + 1 WHERE $id = 1"; mysql_close() Then it's never going to work! You'll want to declare the query before executing it: $sql = "UPDATE comments SET LikeTotal = LikeTotal + 1 WHERE ID = 1"; mysql_query($sql);
-
As soon as the page loads, insert a new record and return the insert id (mysql_insert_id()) or lookup the next available id (mysql_insert_id()). You could then store this id in a session variable to pass from page to page (popping it into a hidden input field if you need to). PDid i understand your question correctly?
-
You would be a lot quicker using: file_get_contents() to echo the contents of $file: echo file_get_contents($file);
-
Retreiving more data (sorry, cant be more especific)
theverychap replied to soltek's topic in Javascript Help
To get the ID too, you may have a slight restructure ahead: Instead of this: while ($row = mysql_fetch_array($result)) { $images[] = "http://URL.org/books/images/{$row['image1']}"; } Do this: while ($row = mysql_fetch_array($result)) { $images[$row['id']] = 'http://URL.org/books/images/' .$row['image1']; } This will require your Javascript function: function mycarousel_getItemHTML(url) to be passed an array (id, url) instead of the single argument (url)... Does that get you on the right track..? -
how to create the message box when i ckick on ?
theverychap replied to bindiya's topic in Javascript Help
I take it you are not referring to a regular Javascript Alert() pop-up dialog box? (if you are then <span onclick="alert('some text');">click me</span> would do that.) If you want a nicely formatted help tip, it would be best to learn exactly what you are doing, i.e appending elements to the dosument etc. OR you could just pickup jQuery and use one of the many great built in features and/or one of the plugins available... -
Excellent, thanks man EDIT: (20 minutes later) looks like a great OOP resource - maybe i'll finally understand OOP properly!
-
Quoting czambran from post: http://www.phpfreaks.com/forums/index.php?showtopic=51603 " I recently decided that It was time for me to learn the OO capabilities of php and I bought this book:"PHP5 Power Programming" which waas co-authored by the co-creator of the php and zend engine. I highly recommend the book. " I think this is the next book i'm buying too Steelman: good idea to pin this topic, i'm hoping it will help us all.