Jump to content

Vorotaev

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

About Vorotaev

  • Birthday 10/08/1981

Contact Methods

  • Website URL
    http://

Profile Information

  • Gender
    Not Telling
  • Location
    Canada

Vorotaev's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, now I'm confused too as to what you want the rollover to do. If you want the full sized picture to appear on the left when the mouse is placed over the thumbnail, you'd use: [code]// The full size image. <img id="imgfull" src="tile1_full.jpg"> // A sample thumbnail. <img src="tile2_thumb.jpg" onmouseover="imgfull.src='tile2_full.jpg';">[/code] ...as an example.
  2. [!--quoteo(post=362860:date=Apr 8 2006, 05:30 PM:name=niza)--][div class=\'quotetop\']QUOTE(niza @ Apr 8 2006, 05:30 PM) [snapback]362860[/snapback][/div][div class=\'quotemain\'][!--quotec--]I would like to pass the value $adID from the radio buttons [code]<input name='vAd' type='radio' value='$adID'>[/code] to this link here: [code]<a href='edit_add.php?id=$adID'>Edit</a>[/code] But no matter what radio button I choose, when I click the Edit link, the ID doesn't change. Any sugestions? Thanks. [/quote] Unfortunately, what wildteen88 said is correct. PHP parses the page before ever sending it, and has no way to change the ID thereafter. You should use Javascript instead: [code]<script type="text/javascript"> function uplink() {     document.getElementById('ulink').href = 'edit_add.php?' + document.getElementByName('vAd').value; } </script> <input name='vAd' type='radio' value='$adID'> ... <a id="ulink" href='edit_add.php?id=$adID'>Edit</a>[/code] In this example, you would add the ID of "ulink" to the link in question so Javascript can interact with it.
  3. The function mysql_fetch_array will give you an array which contains the last row affected by the query, with the elements of the array being the columns in the affected row. I was sure there was a function that returned more than just the last row affected, but this works for our purposes anyways. In this case you don't need to sort the results at all. You could use ORDER BY column_name DESC in a query to point out that you want the column results sorted by descending order, however. --EDIT-- Oh, yes. The problem. Quite right. Perhaps you should pass the result data to the next form, and find out the ID using mysql_fetch_array on that page.
  4. [!--quoteo(post=363028:date=Apr 9 2006, 01:00 PM:name=SomeGuy1337)--][div class=\'quotetop\']QUOTE(SomeGuy1337 @ Apr 9 2006, 01:00 PM) [snapback]363028[/snapback][/div][div class=\'quotemain\'][!--quotec--] your oviously very inexpiraneced with progrmaing, which is fine, thats why your hear asking questoins. i am not sure what you are trying to do, you need to be more clear. i think you want it that when you press the roll over button to goto a section on your site you want php and mysql to show that content when you press the button? you will have to be more sepcific before anyone can offer any usefull advice. [/quote] Technically it's scripting as opposed to programming. He wants to use a basic rollover; the image changes when you put the mouse on it. He wants to do so with PHP and MySQL, however, which isn't possible for the reasons explained by ToonMariner. A rollover with Javascript is as simple as: [code]<img src="pic.jpg" onmouseover="this.src='new.jpg';" onmouseout="this.src='pic.jpg';">[/code] [Fixed the quotes.]
  5. Out of curiousity, why use two forms? You could use one form, have it contain both the member information and the ad information, and have the script which parses the input query both, one after the other. After the first query, I'd sort the affected rows in descending order to get the last row changed, and grab the ID from that. Then just do the second query.
  6. [!--quoteo(post=363015:date=Apr 9 2006, 12:03 PM:name=me1000)--][div class=\'quotetop\']QUOTE(me1000 @ Apr 9 2006, 12:03 PM) [snapback]363015[/snapback][/div][div class=\'quotemain\'][!--quotec--]when I take out [code]<h1 id="siteName"> </h1>[/code] it quits working so I try to take out just the part of it and it still doesnt work! BTW that 2nd javascript in the page (at the bottom) is in my template page too [/quote] Certain tags won't display if they are empty. The non-breaking space is commonly used in this situation to force the tag to display. That may, or many not, have anything to do with why the sub-menus aren't working.
  7. That's perfect, thank you. ^_^ **SOLVED**
  8. This is probably a n00b question, but how would one go about using PHP to detect the version of MySQL someone is using? Much thanks in advance.
  9. [!--quoteo(post=362628:date=Apr 7 2006, 03:47 PM:name=AdamPGT)--][div class=\'quotetop\']QUOTE(AdamPGT @ Apr 7 2006, 03:47 PM) [snapback]362628[/snapback][/div][div class=\'quotemain\'][!--quotec--] The Options are being generated dynamically using PHP/JS.....even after looking at the page source when everything has been created no <option> tags show up. --Adam [/quote] When using Javascript to dynamically produce code, the changes will not be reflected in the source HTML. The source only shows the page as it was when it was first compiled. Just so you know.
  10. [!--quoteo(post=362904:date=Apr 8 2006, 09:21 PM:name=Gutspiller)--][div class=\'quotetop\']QUOTE(Gutspiller @ Apr 8 2006, 09:21 PM) [snapback]362904[/snapback][/div][div class=\'quotemain\'][!--quotec--] That looks like it might work, but I don't know much about coding other than following peoples instructions. My ad code is provided by an ad company so it's already in a script tag not site url and ad image. Can you help me with what exactly I need to put into the page code to get it to refresh every 30 seconds? [/quote] [code]<script type="text/javascript"> setTimeout("myfunction()",1800000); </script>[/code] The above Javascript would call the function "myfunction" every 1800000 milliseconds -- every 30 minutes. We'll need two extra things: the first is an array of images and their matching links. [code]// Produce two new arrays to hold the information. var banners = new Array(); var links = new Array(); // The banners array holds the URLs of 4 banners. banners[0] = "banner1.jpg"; banners[1] = "banner2.jpg"; banners[2] = "banner3.jpg"; banners[3] = "banner4.jpg"; // The links array holds the matching links for the banners array. links[0] = "http://www.asite.com/"; links[1] = "http://www.anothersite.com/"; links[2] = "http://www.notasite.com/"; links[3] = "http://www.asdfghjkl.com/";[/code] You would then need to have myfunction() look something like this: [code]function myfunction() {     // Update the banner image URL.     document.getElementById('ad').src=banners[i];     // Update the site the banner links to.     document.getElementById('url').href=links[i];     // Increment i so a different banner/link shows next time.     i++;     // If the variable i gets larger than the largest number in our arrays, set it back to 0 (reset the banner rotation).     if(i > 3) {         i = 0;     } }[/code] There are a few problems; one, I can't be sure updating the banner won't steal focus (I haven't tested it). Second, if you don't produce the advertisement code yourself, you can't control if they add an ID to the banner or link. No ID, no updating with Javascript. :(
  11. When you say it's not working, do you mean you don't receive an alert for an invalid email address, or the form doesn't submit? The latter would likely be because you don't have an ACTION property set on your form telling it where to send the information. Also, the above isn't very strong validation. I could use aa.@ as my email address, and it would go through. It would be better to use a regex like: [code]var str = subscribe.email.value; if (str.match(/\b^[a-zA-Z0-9_.]+@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/\b) {     // Email address is valid } else {     // Email address is not valid }[/code]
  12. [!--quoteo(post=362866:date=Apr 8 2006, 05:59 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Apr 8 2006, 05:59 PM) [snapback]362866[/snapback][/div][div class=\'quotemain\'][!--quotec--] Is this a "blanket" conversion of all PHP? I have over 800 php pages and only want to convert specific files. [/quote] Yes, that would convert URLs for all PHP files. If you wanted to select only a handful of files, it would be better to use: [code]redirectpermanent /oldpage.php http://www.somesite.com/newpage.html [R][/code] Bearing in mind that the former link [u]should[/u] be a path.
  13. [!--quoteo(post=358958:date=Mar 27 2006, 01:51 PM:name=dbrimlow)--][div class=\'quotetop\']QUOTE(dbrimlow @ Mar 27 2006, 01:51 PM) [snapback]358958[/snapback][/div][div class=\'quotemain\'][!--quotec--] I changed @ 10 of my php pages back to html. I revised the pages with pure css layout and converted the navbar includes insert to an external jscript navbar write. What I want to do is have anyone who bookmarked the php versions of the pages auto-redirected to the new html versions. I am temporarily using a redirect link within the php pages themselves. Thanks, Dave [/quote] Place the following in the .htaccess file (if mod_rewrite is available): [code]RewriteEngine on RewriteRule ^/([a-z][A-Z][0-9]-/+).php$ $1.html [R] [/code] That should redirect all .php requests to the respective .html equivalent (page.php should become page.html, index.php should become index.html, guestbook.php should become guestbook.html, and so forth).
  14. [!--quoteo(post=362819:date=Apr 8 2006, 12:35 PM:name=Trevors)--][div class=\'quotetop\']QUOTE(Trevors @ Apr 8 2006, 12:35 PM) [snapback]362819[/snapback][/div][div class=\'quotemain\'][!--quotec--] Heya all i got a small question on how to paste a text when you single click it and paste it into a textbox using javascript. Im trying to create a "message function" on one of my websites but i have never been any good at javascripting. I got one box where i list a persons friends and one send message form, when someone clicks on one of the names on the friendlist it should paste into the send to box. Is there any easyway doing this? Best Regards Trevors [/quote] [code]// Function to paste friends. <script type="text/javascript"> function pastefr(friend) {     document.getElementById('recipient').value = document.getElementById(friend).innerText; } </script> // Example of friends list. <select size="4" onchange="javascript: pastefr(this.options[selectedIndex].id)">     <option id="f1">Michael87</option>     <option id="f2">xx_Hot_Debbi_xx</option>     <option id="f3">z3r0_t0n</option>     <option id="f4">Amy_Winston</option> </select> // Example of form. <form action="sendmessage.php" method="POST">     <input type="text" size="16" id="recipient" /><br />     <textarea cols="40" rows="5" id="message"></textarea><br />     <button type="submit">Send message</button> </form>[/code] All the better if you have the screenname listed as a value in the <option> tag. Of course, this can be modified to use something other than a SELECT tag, but you get the gist.
  15. [!--quoteo(post=362805:date=Apr 8 2006, 10:35 AM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Apr 8 2006, 10:35 AM) [snapback]362805[/snapback][/div][div class=\'quotemain\'][!--quotec--] That's not right. That selector would say "apply the same thing to the something class, the td tag, and the th tag." That wouldn't work, would it? [/quote] My understanding is that was what was desired... to have all three (TD, TH, and anything with the "something" CLASS) share the same attributes. Hence why they were all listed together on the same line. I may be mistaken. If you desire only TD and TH tags with the CLASS of "something" to share properties, you could use: [code]TD[class=something], TH[class=something] { stuff }[/code] [!--quoteo(post=362806:date=Apr 8 2006, 10:43 AM:name=EriRyoutan)--][div class=\'quotetop\']QUOTE(EriRyoutan @ Apr 8 2006, 10:43 AM) [snapback]362806[/snapback][/div][div class=\'quotemain\'][!--quotec--] ... okay, just to make things easier... (?) Is there somewhere that gives good help on selectors? I've looked around, and they only give the basics, or just kind of... expect you to know it. ><; I think .st td,.st th{stuff} worked... might be wrong, tho... I'll go check... and as for the table, I know it automatically updates to the widest element, but the problem is that I've got a page that dynamically updates its pictures (all of which have different widths) (go PHP!) I want to leave it so that it automatically resizes, but without the chance of the scrollbar at the bottom if they're using lower resolutions... other options would be appreciated. -smiles- [/quote] I like [a href=\"http://www.w3.org/TR/REC-CSS2/selector.html\" target=\"_blank\"]the W3C page[/a], but it's rather technical. You could try [a href=\"http://css.maxdesign.com.au/selectutorial/\" target=\"_blank\"]this tutorial[/a]. As mentioned, the only way I know of to prevent the page from scrolling while having the table snap to the width of the content is MAX-WIDTH. MAX-WIDTH will not allow the table to expand past the given size constraint, but the table will resize itself automatically up until that point. Internet Explorer doesn't support MAX-WIDTH though, so it may be moot.
×
×
  • 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.