Jump to content

Yuval200

Members
  • Posts

    79
  • Joined

  • Last visited

Posts posted by Yuval200

  1. "As far as the header errors, there is nothing in the code you posted that would cause it (other then possibly having an invalid connection given to the mysql_select_db function). The reason has to be somewhere else."As I fought, thanks :)Then PHP just hates me, that's logical..Thanks for the tips anyway.. I'll just put the DB info in a data file and again in the get file..Again, Thanks alot for all the help guys :)

  2. So if I got you guys right, you're saying that I can't put DB information in constants? That's interesting, because I once used a larger DB file that contained the following lines and more, and it did worked.So, you're talking about notice errors and all that stuff, can I please just have a list of all the things I need to fix? My English skills are not that strong as you might know..And yes, the error I'm getting is that "Headers allready sent" thing.Thanks guys :)

  3. I'm really sorry for the late post :) Anyway, that's the code:

    <?php	define(yp_mysql_connect			, mysql_connect("localhost" ,"root"))		;	define(yp_mysql_select_db		, mysql_select_db("yuvpost", yp_mysql_connect));		$form_name			= trim(mysql_real_escape_string($_POST["post_name"]))						;	$form_content		= trim(mysql_real_escape_string(nl2br(stripslashes($_POST["post_content"]))));	$form_date			= date('j/n/Y G:i')															;?>

    And I tested the file and clear all the content from it, and it worked great.. I'm insane!

  4. It's hard to say without seeing some code.
    The code doesn't matter, because when I don't include the file, but add ALL it's content, it still works..Lets say that I have 1.php and 2.php, 1.php content is:
    x

    2.php is:

    y

    When I include 1.php in 2.php, it gives headers errors, but when I copy all the code from 1.php to 2.php, like:

    xy

    It works perfectly..I you still don't get the errors, then I'll give the real codes for the files..Thanks.

  5. Can you post some code so we can see what is going on. From the sound of it, it seems your getting the classic header error in which case your outputting information after the header has already been displayed. if you can post your code or a similar example of your code we might be able to see whats going on.
    I know what error you're talking about, there is no "echo" things in the DB file. When I paste ALL the code from that file to the get.php file, it's ok, otherwise, header errors.
  6. Hey again guys :)I have a file named get.php that does all the header commands in my system, works great.Problem is, I use the file to do some MySQL commands too, so I must include a file with the connection details ect. Now, it works great too, but a week or so ago the file made the get page to die and print some headers and outpost errors.The thing I dont get is, when I copy all the commands from the included DB file to the get file and replace the include line with those commands, it all works great.I'm desperate :)Thanks,Yuval.

  7. Hello again guys :-),Now, I have a short code using CSS3 opacity thing, it goes like this:

    document.body.style.opacity = '0.75';

    It works well, only one problem- the primitive IE doesn't support this.I know IE has an opacity filter, but I'm not sure how to make it work with the style method in HTML DOM.Could anyone help me?Thanks :)

  8. Yes, I had that problem too. Many examples in html use uppercase letters wherever they want. It works because html is not case sensative, although valid xhtml is always all lowercase. JS however is case sensative so when you use the same name you got used to in html it doesn't work. It doesn't generate an error, it does something totally different.
    Yes, I use XHTML T too.And I know Javascript is key-sensitive, I fought those events are uppercase (like onClick) because of normal HTML.
  9. Hello again guys :)This time I have a PHP problem regarding sessions. So basicly I have three pages, one is cplogin.php that works fine and isn't relavent, get.php and admincp.php. This is get.php:

    <?php	include_once("data.php");	if ($form_name && $form_content != "") {		mysql_query("INSERT INTO posts (post_sender, post_content, post_date, post_id) VALUES ('$form_name', '$form_content', '$form_date', NULL)", yp_mysql_connect);		header("Location: main.php?page=outpost");	}		elseif ($cplogin != "") {		if ($cplogin == "****") {			session_start();			$_SESSION['cpacaccess'] = 'true';			header("Location: main.php?page=admincp");		}				else			header("Location: main.php?page=cplogin&error=true");	}		else		header("Location: main.php");?>

    I censored the pass if you don't mind..and admincp.php:

    <?php if (isset($_SESSION['cpacaccess']))		echo <<< END		<div id="container">Hello		</div>END;else echo "2";?>

    The header redirects fine, the problem is with the session, it didn't echoed a thing, so I add the else part, and it echoed "2", so the session is not set. Why?Thanks in advance :)

  10. Then you will have a valid XHTML Transistional document. Which is really nothing more than slightly cleaner HTML tag soup
    Yes, I know. As I said, strict is too strict IMO. But still, XHTML T is still better then HTML, even a little.
  11. So the problem is that the code executes one more time, and in that last time, it cannot find other tags, so it dies? I see, thanks guys, it works now :)One last question- I haven't managed to do a styling thing in JS with a combinated event. I tryed something like:

    document.body.style.color.onClick = 'red';

    But it doesn't work.. Do you have any ideas?

  12. what??? not more than 1 for loop, that is bogus. What is the exact error? there is no limitation to the number of for loops you can have.
    I don't get it either. And I never get JS errors. Are they? I know there are errors in PHP for an example, but I never saw JS errors. How can I see the errors? (I'm using FF 1.5)
  13. Ok, sorry for the double posting, but I got my error:It doesn't allow the .js document to have more then one for loop.So I have the following code:

    //General Varibles. 1/11/06 16:57var browserType = navigator.appName;/************************************************************************/if (browserType == 'Microsoft Internet Explorer') {	document.body.style.overflowY.onClick = 'auto';}//Tags Varibles. 1/11/06 16:57var tags_input_button	= document.getElementsByTagName("input");var tags_table			= document.getElementsByTagName("table");var tags_dt				= document.getElementsByTagName("dt")	;/************************************************************************/for(a=0;a<=tags_table.length;a++) {	tags_table[a].cellPadding="0";	tags_table[a].cellSpacing="0";}for(i=0;i<=tags_input_button.length; i++) { //Styling definitons for <input /> button elements. 1/11/06 16:50.	if(tags_input_button[i].type == "submit" || tags_input_button[i].type == "reset") {		tags_input_button[i].style.border			= '1px solid black'	; //Border color.		tags_input_button[i].style.backgroundColor	= '#CFCFCF'			; //Background-color color.		tags_input_button[i].style.color			= 'black'			; //Text color.				if (browserType == 'Microsoft Internet Explorer')			tags_input_button[i].style.fontSize		= 'xx-small'		;	}} for(i=0;i<=tags_dt.length;i++){	tags_dt[i].innerHTML+="?";} 

    It only executes the code in the first loop he finds, And doesn't even tries to execute the other loops after the first loop.Anyone got an idea?Thanks guys, you helped me alot :)!

  14. no, strict is the recommended way of doing it. Transitional is for instances when you need to use a depreciated tag like <embed> or you don't want to take the extra time to write strict code. IMO if you are going to use transitional XHTML you might as well stick with HTML.
    I haven't read much doctypes, so I'm not that of an expert, but XHTML 1.0 Strict has all those rules, like you can't use a depracted tag or an attribute. Why do I need to involve JS just because I want the <a> target to be _blank or something like that?I don't want to use all these rules, but still want to have a valid XHTML document.
  15. this logic is wrong i<=tags...this will cause the loop to error (index out of range) on the last number.use i<tags.... instead and see if that makes a difference. My guess is that the cellspacing and cellpadding aren't being applied to yiour tables either.
    Nop.. I don't think it's the case. The cellpadding and cellspacing are being applied to my tables. But I did tryed changing the <= operator to < in the dt for loop, didn't do it.I really don't get it.. I wanted to test so I added the following code to the tag:
    <dt onclick="this.innerHTML+='?'">

    And it worked perfectly. I don't get it.

  16. I know there is a <dt> tag, I was guessing because you were mentioning tables in the same post. I said there were no <dt> on the page based on that assumption since you have not provided the code for us to look at.Post the full code. I t will make it easier to debug and understand what you are having trouble with.
    Oh, I see.. Hold on please :)
    <!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="stylesheet" type="text/css" href="css.css" />		<script type="text/javascript" src="script.js"></script>		<link rel="shortcut icon" href="favicon.png" />		<title>YuvPost! Posting System</title>	</head>	<body>  <dl>   <dt>Remmember Me</dt>   <dd>If you check this check box, then the system will plant a coockie in your computer that will remmember your nickname for 4 days. We suggest that you won't check the check box if you share this computer with other people.</dd>  </dl><a href="java script:void(0)" class="script" onclick="close_window()">Close this window.</a>		<br /><br />		<noscript>Javascript needs to be activated for better surfing.</noscript><br />		<div id="copyrights">			<p><span class="name">YuvPost!</span> version 1.0. All rights reserved to <a class="normal" href="mailto:yuval_ritt@hotmail.co.il">Yuval200</a><sup style="font-size: x-small">©</sup>, favicon by <a class="normal" href="http://www.famfamfam.com" target="_blank">Mark James</a>.</p>			<p><!--[if IE]>Best viewed with <a class="normal" href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a><br /><![endif]-->Valid <span class="help"><a href="http://validator.w3.org/check/referer" target="_blank" class="normal">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank" class="normal">CSS</a></span>. <a href="main.php?page=cplogin" class="normal">Admin login</a>.</p>		</div>		<script type="text/javascript" src="htmlhandeling.js"></script>	</body></html>

    And the htmlhandeling.js file (That's were I stored my table thing, and were I tried to get the dt thing to work..):

    var tags_table	= document.getElementsByTagName("table");var tags_dt		= document.getElementsByTagName("dt")	;for(i=0;i<=tags_table.length;i++){	tags_table[i].cellPadding="0";	tags_table[i].cellSpacing="0";}for(i=0;i<=tags_dt.length;i++){	tags_dt[i].innerHTML+="?";}

    I tried using the :after CSS pseudo, but it doesn't show up in IE. Thanks in advance :)

  17. Oh guys, thanks! That done it!Now, another problem if you could help.. In the bottom of the page, just before the </body> tag, I have placed a script tag with an src attribute, in short- an external JS file.There I included that table code, it worked great, but there is another thing that I wanted to do, and didn't actually worked -> I wanted to place a question mark after every dt tag.So I basicly done this:

    var tags_dt		= document.getElementsByTagName("dt");for(i=0;i<=tags_dt.length;i++){	tags_dt[i].innerHTML+="?";}

    The result, as you guest, nothing. I fought that it might not worked because I already used 'i' in another for loop, but it didn't worked even when I changed the 'i' in the loop to a 'j'.Thanks alot :).

  18. This is interesting-Putting the script on the head section alerted 0.Putting the script on the body section alerted 0.Putting the script on the body tag inside the onload attribute alerted the number of the tds in the document.I really don't get it. Why?I don't want to do those things as a function. How can I do codes like:

    <!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="stylesheet" type="text/css" href="css.css" />		<script type="text/javascript" src="script.js"></script>		<link rel="shortcut icon" href="favicon.png" />	</head>	<body><span class="what2do">Messages so far:</span><br /> <!--Page started: 20/6/2006 13:02 --><!--Page ended: Not yet --><table id="posts_table">				<tr valign="top" class="name_container"><td>					<div>By Nir on Wednesday, October, 2006. 19:52.                             					#<a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=3', 600, 250)" class="postlink">3</a></div>				</td></tr>				<tr class="content_container"><td><div><p>Test. This message does not exist.</p></div></td></tr>				<tr class="margin_row"><td> </td></tr>				<tr valign="top" class="name_container"><td>					<div>By Yuval200 on Saturday, October, 2006. 14:44.                             					#<a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=2', 600, 250)" class="postlink">2</a></div>				</td></tr>				<tr class="content_container"><td><div><p>This is message number 2. TEST.</p></div></td></tr>				<tr class="margin_row"><td> </td></tr>				<tr valign="top" class="name_container"><td>					<div>By Yuval200 on Saturday, October, 2006. 14:44.                             					#<a href="java script: void(0)" onclick="open_popup('main.php?page=showpost&postid=1', 600, 250)" class="postlink">1</a></div>				</td></tr>				<tr class="content_container"><td><div><p>Hello,<br />This is a test message, "test".</p></div></td></tr>				<tr class="margin_row"><td> </td></tr></table><a href="main.php?page=form" class="postlink" id="postmessage">Post a message</a>.		<br /><br />		<noscript>Javascript needs to be activated for better surfing.</noscript><br />		<div id="copyrights">			<p><span class="name">YuvPost!</span> version 1.0. All rights reserved to <a class="normal" href="mailto:yuval_ritt@hotmail.co.il">Yuval200</a><sup style="font-size: x-small">©</sup>, favicon by <a class="normal" href="http://www.famfamfam.com" target="_blank">Mark James</a>.</p>			<p><!--[if IE]>Best viewed with <a class="normal" href="http://www.mozilla.com/firefox/" target="_blank">Mozilla Firefox</a><br /><![endif]-->Valid <span class="help"><a href="http://validator.w3.org/check/referer" target="_blank" class="normal">XHTML</a> and <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank" class="normal">CSS</a></span>. <a href="main.php?page=cplogin" class="normal">Admin login</a>.</p>		</div>	</body></html>

    Oh, and thank you guys for helping me, I'm really greatfull :)

  19. Hi again guys :)This time I have a really annoying problem, hope you could solve it. I want JS to automaticly style tags using HTML DOM (Don't tell me to use CSS, because it's not what I need).So the first thing I tried to look at some code that Choco wrote at his blog, and changed it abit:

    as=document.getElementsByTagName("table");for(i=0;i<=as.length;i++){as[i].cellPadding="0";as[i].cellSpacing="0";}

    Yes, as you could imagine, it didn't worked.I tried to do something basic, that will tell me how many tags are in a document. So I wrote this short line:

    alert(document.getElementsByTagName('link').length)

    Printed 0. Then I replaced the 'link' with a 'td', 0. JS, why do you hate me :{?I'll be really greatfull if you could help me with my problems.Yuval.

×
×
  • Create New...