Jump to content

Dale_G

Members
  • Posts

    74
  • Joined

  • Last visited

    Never

Everything posted by Dale_G

  1. Hmm, he's offline. Meh, topic is still open, remains "unsolved".
  2. Okay, there is webpage which I'm getting through file_get_contents. The part I want to get is this <td align="right" class="head-row"> <div id="numbertext">745</div> <br><br> <div id="numbertext">873</div> <br><br> <div id="numbertext">2324</div> <br><br> </td> But, no all of that, you see the number 745? I'd need to be able to get that number by itself. Don't really need the other numbers, just the first number between the <div id="numbertext"> and the </div> tags. The thing is...the div '<div id="numbertext">' appears multiple times before AND after this block of code, but the '<td align="right" class="head-row">' only appears once, which is why I BELIEVE it needs to be..focused on. Not sure though, basically..you see from the above code, I need to get that number 745 by itself. Thanks guys!
  3. Hey everyone. Say I have a string, which...could be any combination of letters and numbers. For example. $string = 'fhkhj4h21j'; How can I put ALL of the characters into an array and access them by $string[0], $string[1], $string[2], and so on and so on... Basically...exploding the string by..nothing! Regardless of string content (numbers and letters), all individual characters will be put into an array. How can that be done?
  4. Oh okay..wow how simple. So basically.. In an if statement using || or &&, if you use || such as if ( 1 == 1 || 2 == 2 ) { DO THIS } it means that ONE of them has to be true, but if you use && it means both of them has to be true. Am I right?
  5. Right, I have a question. I've seen the use of the double pipe character || and the double and character && in PHP alot. Now, this probably isn't the case, but I often see them being interchanged quite frequently. I'm sure theres a difference between the two, can someone help explain that to me? Basically, what's the difference between '||' and '&&' and how would you make use of them?
  6. Ah, that's right.. Well, thanks for your help everyone. I've got my answer now.
  7. Right, right I see thanks. So, it wouldn't be possible to even check if a cookie exists? Not even reading it's contents, just, maybe even attempting to create it? What happens if you attempt to create a cookie that already exists?
  8. Hey there, anyone familiar with MySpace? I am, for those of you who don't know it's a fun little site you can sign up to log in, meet friends, talk, chat, whatever. Anyway, they seem to store an awful lot of cookies on your computer. One is called "UNIQUELOGINTAKEOVER_XXXXXXXX", the X's being your 8 digit Friend ID. Everythings encrypted, don't worry I'm not out here for passwords. But, would it be possible to list all cookies on your computer from another domain? Or, at the very least is it possible to...see if a cookie exists, just by name, and return a true or false, without revealing it's contents? Like, say I know someones Friend ID and it's 11111111, would it be possible to check for the existence of "UNIQUELOGINTAKEOVER_11111111"? if ( isset( $_COOKIE['UNIQUELOGINTAKEOVER_11111111'] ) ) { echo 'HEY 11111111!!'; } else { echo 'WHO ARE YOU?'; } Would anything like that be possible? Keep in mind that these cookies are from http://www.myspace.com and this script resides on a different server. I know there are some restrictions involving cookies on other servers, but, just wondering if it's possible. Thanks!
  9. Hello everyone, This is a snippet of my script right now... $time = "\n\nTime: ".date('h:i:s A'); fwrite($handle, $time); This code is apart of a script in which it gathers information and logs it to a .txt file. Now, what I'd like to do is offset the time it's outputting ahead by 3 hours. So if it's logging Time: 8:44:21 PM I'd like it to be offset by 3 hours, to match my local time. So it would now be... Time: 11:44:21 PM Thanks!
  10. So, why didn't you say that in the first place? I don't see where you want to use this solution. I hope you realize, that you're opening yourself up to possible SQL injection with your code. At the very least do something like: <?php if ($action == "submitnews" && $username != "") { $icon = mysql_real_escape_string(stripslashes($_POST['icon'])); $category = mysql_real_escape_string(stripslashes($_POST['category'])); $date = mysql_real_escape_string(stripslashes($_POST['date'])); $ldate = mysql_real_escape_string(stripslashes($_POST['ldate'])); $title = mysql_real_escape_string(stripslashes($_POST['title'])); $smallbody = mysql_real_escape_string(stripslashes($_POST['smallbody'])); $body = mysql_real_escape_string(stripslashes($_POST['body'])); $mysql_query = "INSERT INTO `news` ( `icon`, `category`, `date`, `ldate`, `title`, `smallbody`, `body` ) VALUES ('".$icon."', '".$category."', '".$date."', '".$ldate."', '".$title."', '".$smallbody."', '".$body."' )"; mysql_query($mysql_query); echo "<font face='Arial' size=2>News Added!<br><br><a href='?action=verified'>Go Home</a></font>"; } ?> Ken Not sure, I'm saying it now though. I'd like to use it, because that's how I'd normally write my news articles. Each line would have be enclosed in <p></p> tags so they would be spaced and even. Also, this form is on a page that is non public and protected by a log in which only I can access.
  11. Okay well, I'll just post my code from the section this involves. /* +------------------------------------------------------- | if submitnews, submitting the news to the sql db +------------------------------------------------------- */ if ($action == "submitnews" && $username != "") { $icon = ($_POST['icon']); $category = ($_POST['category']); $date = ($_POST['date']); $ldate = ($_POST['ldate']); $title = ($_POST['title']); $smallbody = ($_POST['smallbody']); $body = ($_POST['body']); $mysql_query = "INSERT INTO `news` ( `icon`, `category`, `date`, `ldate`, `title`, `smallbody`, `body` ) VALUES ('".$icon."', '".$category."', '".$date."', '".$ldate."', '".$title."', '".$smallbody."', '".$body."' )"; mysql_query($mysql_query); echo "<font face='Arial' size=2>News Added!<br><br><a href='?action=verified'>Go Home</a></font>"; } Also, specifically for this I'd be using <p></p> tags! So, you can see why they'd need to be repeated for each line.
  12. For this type of application that would not work, if it was that simple, i'd just have that span code in place to begin with, none of this tinkering with HTTP_POST_VARS and formatting that!
  13. Hmm, this almost does what I'm trying to do, except it turns. One. Two. Into... <B>One. </B> <B> </B> <B>Two.</B> Where it should be. <b>One.</b> <b>Two.</b>
  14. Hmm...this one seems to do something. But, not what I'm looking for. It turns hey. how are you? into <b>hey. </b><br><b> </b><br><b>how are you?</b> Where it SHOULD be.... <b>hey.</b> <b>how are you?</b>
  15. This does not seem to work for me. They do not get bolded. Keep in mind I am using this code to insert into the SQL DB. $mysql_query = "INSERT INTO `news` ( `icon`, `category`, `date`, `ldate`, `title`, `smallbody`, `body` ) VALUES ('".$icon."', '".$category."', '".$date."', '".$ldate."', '".$title."', '".$smallbody."', '".$line."' )";
  16. Hello everybody, I'll try to make this as simple as I can. I have a home made very basic News CMS system. Has a form where I can input the data, and writes it to an SQL Database. Some fields I have are title, author, date, and body. Now, the main body field is a text area in which whatever I enter, that will be the main body content for the news article. This is it... <tr> <td><font size='2' face='Arial, Helvetica, sans-serif'>Body:</font></td> <td><textarea name='body' cols='60' rows='9'></textarea></td> </tr> ..And it gets accessed by this when I submit it! $body = ($HTTP_POST_VARS['body']); Pretty basic... But now what I'd like to do is seperate the body content by LINE BREAK and enclose each seperated text with <b></b> tags. So basically, say this is what I enter. Oh, hey everyone! What's up? This is a news article. I like it very much! Lol. =) I'D LIKE IT TO BECOME THIS... <b>Oh, hey everyone! What's up?</b> <b>This is a news article.</b> <b>I like it very much! Lol. =)</b> You see how that works out? The text would be separated by the line breaks, or the spaces in between them, and then at the beginning of it would be a <b> tag and at the end a closing </b> tag. So, I've been working on ways to do this, but I don't really have a firm grasp on it...Perhaps adding a function that does this? function convtobr($str) { $str = explode("/n" $str); $str = ("<b>$str</b>"); return $str; } This is just a notion of a function, not working and..I don't think it's proper, however it may point someone in the right direction. Well, thanks everyone!
  17. Hey everyone. Let's say I have a php file at www.mysite.com/image.php. This PHP file generates an image. So using this code <img src="www.mysite.com/image.php"> the image would show up. The site this is going on has some sort of restriction and all IMG tags must end with a .png, .gif, etc. So I need to be able to use this code <img src="www.mysite.com/image.png"> yet retrieve image.php. So basically I need to know how to rewrite image.PNG to image.PHP using .htaccess Thanks!
  18. I had a feeling you'd be the one who'd answer my cry! Thank you very much. You're Member Title is well deserved! I'm not sure if you're thanked alot, but, from the browsing I've done around the site while waiting for my answer I see that you're one, if not the most, helpful people here! So thanks!
  19. Hey everyone, as you can see I'm new here. I'm working on a new section for a site. Basically it's a layout creator, mostly, with a few customization options. Basically as you can see from the HTML below, there is a checkbox with the id "network" and a text input field with the id "username". <div style="text-align: left;"> <b>2. Creation</b> </div> <br> Here you can customize <br><br> <table align="center" cellpadding="5" width="95%" style="margin: 3px; padding: 5px; border: 2px solid black;"> <tr> <td align="center"> <table align="center" width="98%" cellspacing="1" cellpadding="3"> <tr> <td width="50%" style="text-align: center;">Replace the Extended Network Logo with your Dynamic Signature (?)<br><input type="checkbox" id="network" name="network" style="border:none;" value="_s" /></td> <td width="50%" style="text-align: center;">Hide the Comments section (?)<br><input type="checkbox" id="comments" name="comments" style="border:none;" value="_p" /></td> </tr> </table> <input type="text" id="username" size="20" maxlength="12"> <br> <font size="1">If you checked "Replace Extended Network Logo" you MUST enter your name here so the Signature can be created. Otherwise your signature WILL NOT DISPLAY.<br><br>If you'd like to keep the Extended Network Logo LEAVE THE ABOVE FIELD BLANK!</font> <hr> <input type="button" value="Generate my Layout!" style="text-align: center;" onClick="make_sig()" onSubmit="make_sig()"> <div id="urlbox"></div> </table> <br> </td> </td> </table> Basically, I need to know how I can have the username field disabled by default, and then enabled only WHILE the network checkbox is checked. I'm not too sure how to do this. But I have some sort of idea. Perhaps something like this (excuse the sloppy and incorrect structure, this is just to demonstrate) if (document.getElementById("network").checked==true THEN document.getElementById("username").disabled==false) You know, basically something stating WHILE the network checkbox is checked the username field will be enabled and if network is unchecked, username becomes disabled. Thanks.
×
×
  • 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.