Jump to content

xProteuSx

Members
  • Posts

    476
  • Joined

  • Last visited

Everything posted by xProteuSx

  1. I have no idea where to start, and this forum is so phenomenal, so it was a natural place to ask ... I would like to write a script. Here's the idea: I would like my website visitors to be able to go to my webpage and get code for an application that retrieves information from one of my databases. They can then take this code, and embed it on their site, and the retrieved information is displayed on their website. My idea is not ad related, but Adsense is a good example, I think. You get your code, which fetches ads from Google and displays them on your website. I believe that they do it with JavaScript. Where do I start? Thanks folks.
  2. Thanks for your tip on the 'center' tag. Trying to keep up with HTML, CSS, XML, PHP, MySQL, JavaScript, and ActionScript so I fall behind the times here and there Any tips regarding making a div 100% of the page height?
  3. I am trying to make a website, and I need one of the divs to be 100% of the height of the browser window (inner). So far, I have the following CSS: @charset "utf-8"; /* CSS Document */ html { height: 100%; } body { margin: auto 0; padding: 0; background-image: url(images/background.jpg); background-repeat: repeat; font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #ffffff; height: 100%; } div.wrapper { width: 100%; height: 100%; } div.content { width: 980px; height: 100%; background-color: #3F0; } The HTML looks like this: <!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=utf-8" /> <link rel="shortcut icon" href="images/icon.gif" /> <title>Home Page</title> <link href="css.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="wrapper"> <center> <div class="content"></div> </center> </div> </body> </html> What I need is for the 'content' div to be 980 pixels wide, and 100% the height of the webpage. I have tried min-height:100%, just in case anyone is wondering. I have also googled this problem, and have found no working solution. Please help!
  4. thorpe, First of all, thank you for your unending aid. I know its been a while since this topic came up, but to answer your question ... I appreciate all of the replies I receive in this forum. I have learned a few tricks and things here, and I owe a lot of my PHP/MySQL knowledge to the admins here. That having been said, please do not take it personally if I don't take all of the advice that I receive, including yours I usually don't implement new suggestions if I have already found a solution. When I have time, which is not often, I will try the alternate solutions so that I can become a better programmer but, again, that all comes down to time ... and there just ain't enough, if you know what I mean. Cheers to you my friend. Also, thank you for all the help that you have given and continue to give in this forum, from myself and the hundreds (if not thousands) of others which you have helped.
  5. KMD, I'm not very familiar with Facebook and their 'Like' buttons, but if the Facebook format is "http://mysite.net/imagedetails.php?id=1443" then you are stuck. The script accepts a single URL at a time, and it seems as though you cannot attach additional data. I'm just thinking about the receiving end at Facebook. It is designed to receive a single URL without additional data such as a member name (which you would need to refer other users to other images by the same member). Are you trying to send more data than a single URL, in string format, or are you trying to auto-create multiple button for multiple URL's?
  6. Thanks cssfreakie. That actually does not work. I think that I am going to have to build a parser, because the data is a combination of numbers and letters, and is therefore treated as a string. Somehow I have to split each string into components. An example: A13b A = prefix 13 = numerical value b = suffix Then I can group entries by prefix, then by numerical value, then sort entries with the same numerical values by suffix. I don't really have time to do this at the moment, but its definitely a project for the future. Thanks for your input anyways. The issue comes down to the entries being treated as strings, which is a necessity by definition.
  7. Say I have a column in a MySQL database, that contains the following data (each piece of data is in its own row, as stored as a string): 16b 166 13A 13a 4 402c A66 A66b Currently the list sorts as follows: A66 A66b 13A 13a 16b 166 4 402c I need it to sort as follows: A66 A66b 4 13a 13A 16b 166 402c So that any strings that start with a letter are first, followed by numbers in numerical order, with lower case letters coming before upper case letters. This is a huge issue on my website, which has a database of over 35k such numbers, split up into lists. I can't get these sorted properly. At least it would be nice to sort as follows: 1 4 100 344 Instead of 1 100 344 4 Know what I mean? I know that this is complicated, because the variables are strings and not numbers, but is there an easy way to do this?
  8. mmarif4u, Bingo. Thanks.
  9. bindiya, Assuming that your code is as follows: echo"<table><tr><td></td><td>Amount in USD</td><td></td><td><input type='text' name='amnt' id='amnt' /> </td><td></td></tr></table>"; what are you trying to do? Are you trying to check whether amnt is a number? What you should be doing is as follows: $amnt = 10; //just a random number echo"<table><tr><td></td><td>Amount in USD</td><td></td><td><input type='text' name='" . $amnt . "' id='" . $amnt . "' /> </td><td></td></tr></table>"; Then you can check the amnt variable to see whether it is numeric, and create an if statement. For example: if (isnumeric($amnt)) { echo"<table><tr><td></td><td>Amount in USD</td><td></td><td><input type='text' name='" . $amnt . "' id='" . $amnt . "' /> </td><td></td></tr></table>"; } else { echo"<table><tr><td>This product has no price associated with it.</td></tr> } Ofcourse, this means that your variable has to become a php variable.
  10. KDM, I am confused by your explanation of the problem. Please take some time to describe things, step by step to the best of your abilities. I'll check in on this post now and then ...
  11. I am having a problem with what is probably encoding. I am pulling strings from a WordPress database. Below is a sample string: Sed nec neque quis sapien scelerisque aliquet. In in est odio, ac auctor erat. Vestibulum fringilla dapibus sodales. Morbi facilisis egestas arcu, eu semper mi luctus vitae. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sollicitudin, metus sed hendrerit tristique, enim ante venenatis metus, ac consectetur mauris lorem et felis. Phasellus ac purus massa. Aliquam ligula mauris, iaculis et posuere vitae, pellentesque sit amet leo. Praesent at eros et lacus scelerisque feugiat. Aliquam non facilisis libero. Ut blandit leo ut tortor convallis porttitor. Aliquam erat volutpat. Aliquam rhoncus rutrum metus, tempor sollicitudin ante laoreet in. Sed tincidunt nibh a augue euismod sagittis. Fusce ullamcorper ultricies nisi, sit amet elementum mi scelerisque eget. Cras sed elit ligula, sit amet aliquam lectus. Nulla vel mollis nibh. Pellentesque ultricies, dui non aliquam eleifend, tortor ligula blandit dolor, quis interdum diam augue non eros. Nullam id molestie nunc. Integer id tempus est. When WordPress displays this text, it is formatted correctly, with spaces between paragraphs, etc. When I pull the string from the database, and echo it onto a page, the spaces between paragraphs are replaced by spaces, so in the end the output is as follows: Sed nec neque quis sapien scelerisque aliquet. In in est odio, ac auctor erat. Vestibulum fringilla dapibus sodales. Morbi facilisis egestas arcu, eu semper mi luctus vitae. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse sollicitudin, metus sed hendrerit tristique, enim ante venenatis metus, ac consectetur mauris lorem et felis. Phasellus ac purus massa. Aliquam ligula mauris, iaculis et posuere vitae, pellentesque sit amet leo. Praesent at eros et lacus scelerisque feugiat. Aliquam non facilisis libero. Ut blandit leo ut tortor convallis porttitor. Aliquam erat volutpat. Aliquam rhoncus rutrum metus, tempor sollicitudin ante laoreet in. Sed tincidunt nibh a augue euismod sagittis. Fusce ullamcorper ultricies nisi, sit amet elementum mi scelerisque eget. Cras sed elit ligula, sit amet aliquam lectus. Nulla vel mollis nibh. Pellentesque ultricies, dui non aliquam eleifend, tortor ligula blandit dolor, quis interdum diam augue non eros. Nullam id molestie nunc. Integer id tempus est. What can I do to follow WordPress' formatting?
  12. Thank you so much guys! I totally forgot about explode and implode (no, I don't work with arrays very often). If anyone is interested, here is what I came up with: $str = "84,390961CPK_100,'Pink Coloured Cord',15,'390961CPK_100',1"; $elements = explode(",", $str); $elements[1] = "'" . $elements[1] . "'"; $str = implode(",", $elements); echo $str; The output would result in: 84,'390961CPK_100','Pink Coloured Cord',15,'390961CPK_100',1 Now I don't have to pull the rest of my hair out! Thanks soooooooo much!
  13. HELP!!! PLEASE!!! Here's what's happening: I have a string much like this one: $str = "84,390961CPK_100,'Pink Coloured Cord',15,'390961CPK_100',1"; I need to insert apostrophes around the first instance of 390961CPK_100 so it reads '390961CPK_100' and not simply 390961CPK_100. To do this I have made the string into an array as follows: $str_array = str_split($str); Now I need to insert quotes into the array of characters, then convert the whole mess into back into a string. I can't go by hard coded index numbers, because all of the text in this string is variable in length, so I have to go by the first and second positions of the commas. I have no idea how to do this, and it needs to be done yesterday! Mucho Gracias to anyone who can help me with this.
  14. Sorry, I was making a query to two different tables, and I just realized that the second table did not always have a corresponding data set ... got it all worked out ... Thanks anyways.
  15. General idea: DB columns and values for a row 1 (values in quotes): id = '1' color = 'red' size = 'large' thumb = 'img/shirt1.jpg' If I query this: "SELECT * FROM table WHERE id=1;" I can get the values of id, color, size, and thumb. Here are the DB columns and values for a row 2 (values in quotes): id = '2' color = 'red' size = 'large' thumb = '' If I query this: "SELECT * FROM table WHERE id=2;" I don't get values for any of the columns, so id='', color='', size='', and thumb=''. All of this happens just because thumb=''. This is my problem ...
  16. Hi guys! Its been a long time since I have been to phpFreaks ... I love this place! I am working on a DB driven website, and I have come up against a small problem that I cannot solve. I have a table with 15+ columns. One of the columns is a string that contains a link to an image. However, some of the rows in this column are empty, as there is no image file yet. So when I query a row that does have an image associated with it, the query works beautifully. However, if the image column of the query is empty the query does not fail because mysql_error() does not return anything, but ALL of the row values are empty. I have been searching and searching, and have not found an answer to this ... please help. This small problem is keeping me from finishing the site!!
  17. Thanks very much guys. I'm sure that the formatting of the action for the form is correct ... just seems awkward because I have it stored in a string variable using javascript, but I have tested all output and input. Anyways, I have found a bit of a work-around. I just stored the user_id in a cookie, then retrieved it. This hidden field idea is really interesting though ... I will give it a try sometime, because it will definitely come in handy if it works. Thanks for all your replies.
  18. I have been making an upload script that uploads a file and updates a database. One of the database fields is filesize, and I have tried using filesize("file.jpg") to get the filesize. The first value that I got was 2010, which was about right, because this was a 2kb icon. Every other file since, including a 1MB file has been the same size, 2010, however. I have tried clearing the cache by using clearstatcache(), but it has done nothing as far as I can see ... I would appreciate your help.
  19. teamatomic, Thanks for the reference, but I have to come up with something myself, as this is a school assignment. I've tried everything I can think of. I can't be ripping this script apart, or installing it, so unfortunately I won't be able to do anything with this resource. Any other ideas my friend?
  20. Ofcourse, and thanks for helping This is what the Javascript string / HTML end up looking like: <form id="file_upload_form" method="post" enctype="multipart/form-data" action="upload_avatar.php?user_id="+user_id+"> <table width="500" cellpadding="3" cellspacing="2"> <tr> <td><h4>Update Your Avatar (Icon)</h4></td> </tr> <tr> <td><input name="file" id="file" size="27" type="file" /><br /><br /></td> </tr> <tr> <td><input type="submit" name="action" value="Update Avatar" /></td> </tr> </table> </form> upload_avatar.php, the action, looks like this, for example: upload_avatar.php?user_id=1 The actual PHP file upload_avatar.php looks like this: <?php $user_id = $_GET['user_id']; echo $user_id; move_uploaded_file($_FILES["file"]["tmp_name"], './avatars/' . $_FILES["file"]["name"]); ?> If I try to do this ===> $user_id = $_GET['user_id'] <=== the php crashes, without errors. I think this has something to do with the enctype, because it is set to 'multipart/form-data'. Any ideas?
  21. Much appreciated teamatomic but ... (yes, there's always a but) ... This is part and parcel of a client-side AJAX type thing ... so I'm sending the variable using Javascript, and using PHP to upload the file and update the database. The update is based on the user_id. Help would be much appreciated (and please DON'T tell me that here is an AJAX forum here, as I have already posted there). Also, what do you mean by type=file ? Do you mean to include it in the form like this? <form id="file_upload_form" type="file" method="post" enctype="multipart/form-data" action="upload.php?user_id="+user_id+"\>
  22. I am creating a form that uploads a file, but also sends a variable, called user_id, like this: <form id="file_upload_form" method="post" enctype="multipart/form-data" action="upload.php?user_id="+user_id+" \"> This way I can get PHP to upload the file, then also get it to capture the value of user_id using the ol': $_GET['user_id']; But this doesn't seem to work. Any ideas would be much appreciated.
  23. I am trying to so something like this: <form id="file_upload_form" method="post" enctype="multipart/form-data" action="upload.php?user_id="+user_id+"\> So essentially I want PHP to upload the file that is being sent, and also get the variable represented by +user_id+ Is this possible? I can't find an answer anywhere.
  24. Man, everything I tried the first time works, but it was out of sequence. I have it all figured out. Thanks a ton xcoderx. If you're still around, here is my final question: is there a way to have a link with an onclick clause that goes to a different page and runs a function on that page? For example: I am on index.html where there is a link that looks like this: <a href="about.html" onclick="javascript:runme()">About</a> If you click the link it takes you to the about.html page and runs the function runme() which is scripted on that page. Is this possible?
  25. Thanks for your help xcoderx. I have tried these things already, but it turns out that I was doing this correctly. I have narrowed it down to this: one of my variables is not assigning: var outputString = '<table width="650" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="300"> <a href="http://www.amazon.com/Disciplined-Breakdown-Collective-Soul/dp/B000002JCB/ref=sr_1_1?ie=UTF8&s=music&qid=1261206207&sr=1-1"> <img src="img/cover_disk_disciplinedBreakdown.jpg" border="0" /> </a> </td> <td width="25"></td> <td> <font class="title">Disciplined Breakdown</font> <br /><br /> 01. Precious Declaration<br /> 02. Listen<br /> 03. Maybe<br /> 04. Full Circle<br /> 05. Blame<br /> 06. Disciplined Breakdown<br /> 07. Forgiveness<br /> 08. Link<br /> 09. Giving<br /> 10. In Between<br /> 11. Crowded Head<br /> 12. Everything<br /> </td> </tr> </table>'; Any idea why outputString = '' ??
×
×
  • 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.