fobos 19 Posting Whiz in Training

ill see if i can help.

fobos 19 Posting Whiz in Training

So any errors yet?

fobos 19 Posting Whiz in Training

Well on the form part on the first set of code, i changed the php code so i echos all variable into a select element, rather than what you had. Your method make it echo all variables into 1 select element.

<form>
<select name="state" onChange="display(this.value)">
<option value="">-- Select state --</option>
<?php
$query="select * from tbl_state";
$query_result=mysql_query($query)or mysql_error();
while($row=mysql_fetch_array($query_result)){
echo "<option value='".$row['id']."'>".$row['state_name']."</option>";
}
?>
</select>
</form>

On the show_city.php, instead of using $_REQUEST, try using $_GET. Now to test this, try just echoing the results rather than puttin them into a form

<?php
$host="localhost"; // Host name
$username="cbsecpsn_vishal"; // Mysql username
$password="most^^@anted123"; // Mysql password
$db_name="cbsecpsn_cbsecsnip"; // Database name

$state_id=$_GET['state_id'];

mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$query="select * from tbl_city where state_id='$state_id'";
$query_result=mysql_query($query)or mysql_error();
while($row=mysql_fetch_array($query_result)){
echo $row['id'];
}
?>

test that.

fobos 19 Posting Whiz in Training

Well you are echoing something that either should be wrapped in quotes or need to make it a variable. You have

<td><input type='text' name='<?php echo mark.$y; ?>' id='textfield' /></td>

Possibilities

<td><input type='text' name='<?php echo "mark". $y; ?>' id='textfield' /></td>
<td><input type='text' name='<?php echo "mark $y"; ?>' id='textfield' /></td>
fobos 19 Posting Whiz in Training

Hello, i redid your coding and took out the $nt in the action and added a name tag to ur option. Also, just noting, you hae to have a ? mark when passing variables through a URL.

 <?php
 $sql = "SELECT DISTINCT dept FROM sw_lic WHERE dept != ''"; // (1)
 $result2 = mysql_query($sql);
 ?>
 <form action="NB_sw_lic/filter_view.php" method="POST"> // (2)
 <select name="dept"> // (3)
 <?php
 while($nt=mysql_fetch_array($result2))
 {
 echo "<option name='dept' value=$nt[dept]>$nt[dept]</option>";
 }
 ?>
 </select>
 <input type="submit" name="submit" value="Submit">

Now when the form gets submitted filter_view.php, use $_POST['dept'] to get the value.

$nt = $_POST["dept"];
$result = mysql_query("SELECT * FROM sw_lic WHERE dept = $nt")

Let me know if this works

cscheck commented: Solved my question! +0
fobos 19 Posting Whiz in Training

are you sure you wrote the php statement? if so, then you would know about html. put the input tag into the form

fobos 19 Posting Whiz in Training

So whats your problem?

fobos 19 Posting Whiz in Training

assign id's to your form inputs.

<input type="text" name="name" id="name">

then when you submit the form, the php page will grab the id called name

<?php
$name = $_POST['name'];
echo $name;
?>
fobos 19 Posting Whiz in Training

Did you upload the videos to a database, or in a folder?

fobos 19 Posting Whiz in Training

Here is an example on how to read an XML file.
books.xml

<books>
  <book>
  <author>Jack Herrington</author>
  <title>PHP Hacks</title>
  <publisher>O'Reilly</publisher>
  </book>
  <book>
  <author>Jack Herrington</author>
  <title>Podcasting Hacks</title>
  <publisher>O'Reilly</publisher>
  </book>
</books>

readbooks.php

<?php
$doc = new DOMDocument();
$doc->load( 'books.xml' );

$books = $doc->getElementsByTagName( "book" );
foreach( $books as $book ) {
    $authors = $book->getElementsByTagName( "author" );
    $author = $authors->item(0)->nodeValue;

    $publishers = $book->getElementsByTagName( "publisher" );
    $publisher = $publishers->item(0)->nodeValue;

    $titles = $book->getElementsByTagName( "title" );
    $title = $titles->item(0)->nodeValue;

    echo "$title - $author - $publisher\n";
}
?>
fobos 19 Posting Whiz in Training

in your php.ini enter your smpt address and port. Then just use a php script to send the mail. Here is a basic example:

<?php
// Or you can define it in your script, but for security reasons do it in php.ini
ini_set("SMTP","smtp.example.com" );
ini_set("smtp_port","port number" );
// If you need to use a username and password
ini_set("username","postmaster@mydomain.org");
ini_set("password","mypassword");


$to = "somebody@example.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
mail($to,$subject,$txt,$headers);
?>
fobos 19 Posting Whiz in Training

dont know if you make a mistake,but you need <?php on line 26

fobos 19 Posting Whiz in Training

Are you trying to redirect the page with the nested iframe? Basically if you click delete in the iframe, you want it to redirect the main page.

fobos 19 Posting Whiz in Training

Hello,
Ok so here is my dilemma, when im watching a movie or youtube or anything, i use the HD Audio Device which is the default device to use when listening to something. When i switch to my Corsair headphones, the volume still comes from my speakers and not the headphones. If i disable the speakers, then no sound comes out. If im watching a movie using VLC and switch devices, i have to go under the audio setting in VLC and change from stereo, to L/R then presto sound on my default device and vice verse. I dont know why its doing this, because i have never had this problem before. I used dxdiag and everything comes back ok. I re installed my realtek audio drivers from my mobo CD and still the same problem. Here is my info.

If you need my info from dxdiag, let me know. Thanks for the help guys.

fobos 19 Posting Whiz in Training

Good catch, didnt even see that about the SQL SELECT statement.

fobos 19 Posting Whiz in Training

If im not mistaken, array_key_exists checks to see if an array is true. From the php manual:
array_key_exists() returns TRUE if the given key is set in the array. key can be any value possible for an array index.
Example:

<?php
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)) {
    echo "The 'first' element is in the array";
}
?>

So using your statement will not work, and the error for $_SESSION is becuase you dont have a session variable like $_SESSION['reg_error']

if(array_key_exists('reg_error', $_SESSION) && !empty($_SESSION['reg_error']))

Hope this clarifies things.

fobos 19 Posting Whiz in Training
//you
while($arr = mysql_fetch_array($result, MYSQL_ASSOC)){    
    $resultlink = "\n\t<li><a href=\"posts.php?ID={$arr['id']}+{$arr['type']}+{$arr['name']}\">{$arr['name']} {$arr['location']}</a></li>";

// example to try
while ($arr = mysql_fetch_array($results)){
    echo "<a href='posts.php?id='".$arr['id']."&type=".$arr['type']."'>".$arr['name']." ".$arr['location']."</a>";
}
fobos 19 Posting Whiz in Training

well your going to have to post your code for us to see. but here is another link you can look at Click Here, or Click Here, or Click Here

fobos 19 Posting Whiz in Training

Well in my opinion is instead of creating a div then appending stuff to it, make the div in the form, apply a css attribute of visibility:none, add the image and the other div below it and apply a css attribute to them also. Then when success is called, just have:

success: function() {
    $("#mail_succes").show();
    $("#checkmark").fadeIn(3000, function() {
        $("#checkmark2").fadeIn(500);
    });
}

<form>
<div id="mail_succes">
<h2 class="catch_font26" style="background-color:#849fa5; padding:1px; color:#FFF;">Tak for din besked!</h2>
</div>
<div id="checkmark" style="float:left;">
<img src="styles/frontend_img/email_ok.jpg" width="30" height="30"/>
</div>
<div id="checkmark2" style="float:left; margin-left:20px;"><p style="font-size:20px;">Vi vil vende tilbage på din henvendelse hurtigst muligt.</p><br /><p style="font-size:16px;">Hvis I har yderligere spørgsmål kan vi også kontaktes pr. telefon:</p><br /><table><tr><td><p style="font-size:14px;"><b>Telefon nr. </b></p></td><td style="padding-left:15px;"><p>+0045 00 00 00 00</p></td></tr><tr><td><p style="font-size:14px;"><b>Tidsrum: </b></p></td><td style="padding-left:15px;"><p style="font-size:14px;">Alle hverdage fra kl. 9-17.</p></td></tr></table><br /><p style="font-size:14px;">Med Venlig Hilsen</p><p style="font-size:14px;"><b>enkelt-webdesign</b></p></div>
</form>

This is untested, but what you are looking for.

fobos 19 Posting Whiz in Training

well if your database has a row for each checkbox value, then you could just use the if statement:

<?php
if(!isset($row['hobbies']) == NULL) {
    echo "<input id='hobbies' type='checkbox' value='Hobbies'>";
} else {
    echo "<input id='hobbies' type='checkbox' value='Hobbies' checked='checked' />";
}
?>

Dont know if this helps, but its a start.

fobos 19 Posting Whiz in Training

Well i was searching around googling the work cosymantecbfw and i think it relates to ' co symantec bfw' for symantec. Are you running any symantec programs?

fobos 19 Posting Whiz in Training

Try replacing

url: $(planbook).val()

with

$(".planbook").html()

Reason is, because if planbook is a css, then you need to add it with the "." in front of it. Val() is used on form elements, so in this case, if its not a form element, we use .html(). Read this link from jquery on $.ajax. jQuery Ajax

fobos 19 Posting Whiz in Training

Or you could try something like this.

$("table").css({'background-color': '#ffe', 'border-left': '5px solid #ccc'})
fobos 19 Posting Whiz in Training

Try putting the whole ajax function together. I dont know why you broke it up like that.
Change your select statement to this.

echo '<select name="district" class="text" onChange="getCity(this.value)">';

And try using this for your ajax on register.php

function getCity(str) {
var xmlhttp;
if (str=="") {
    document.getElementById("citydiv").innerHTML="";
    return;
}
if (window.XMLHttpRequest) {
    xmlhttp=new XMLHttpRequest();
} else {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4 && xmlhttp.status==200) {
        document.getElementById("citydiv").innerHTML=xmlhttp.responseText;
    }
}
xmlhttp.open("GET","findcity.php?district="+str,true);
xmlhttp.send();
}

Try that.

fobos 19 Posting Whiz in Training

Can you mark it solved!

fobos 19 Posting Whiz in Training

You know another way to do this, is if you are using dreamweaver and If not already installed, use spry framework for ajax.

fobos 19 Posting Whiz in Training

Try this.

Click Here

fobos 19 Posting Whiz in Training

Try this. In this case, you already have the errors being posted in the div, so this will scroll to the div with the errors.

<?php
if(isset($_POST["myform"]) && !empty($errors)){?>
    $('html, body').animate({scrollTop: $("#error").offset().top}, 2000);
<?php } ?>
fobos 19 Posting Whiz in Training

I had the same problem and it turned out that the computers time was not in sync with the server time. After it my computer synced with microsoft's time, windows update worked.

fobos 19 Posting Whiz in Training

This code is compressed. You have to either ask the originator or try to un compress it.

fobos 19 Posting Whiz in Training

in XAMPP, there is a build in mail system called mercury mail. if you want to use smpt, you need to get that info from yahoo, google.. unless your using outlook, then just use that info.

fobos 19 Posting Whiz in Training

Have you tried alerting the dataString to see if the values are being passed?

var dataString = 'name='+ name + '&email=' + email + '&phone1=' + phone1 + '&phone2=' + phone2 + '&phone3=' + phone3 + '&association_name=' + association_name + '&association_city_state=' + association_city_state;
alert(dataString);
return false;

if it is working, then its the php coding. Try looking at Click Here to learn ajax. The php code should still be the same with the input from the variable, but since you want to pass the the variables in a url, make sure you use the $_GET to get the variables.

fobos 19 Posting Whiz in Training

You could also try this

<script type="text/javscript">
function signup(){
    var username = document.getElementById("text_username").value;
    var password = document.getElementById("text_password").value;
    alert(username + " " + password);
    return false;
}
</script>


<form action="do_signup" method="post" onsubmit="signup()">
Username : <input type="text" id="text_username" /><br />
Password : <input type="password" id="text_password" /><br />
<input type="submit" name="submit_button" value="Signup" />

</form>

Or if your form and inputs had a name:

<script type="text/javascript">
function greeting(){
    alert("Welcome " + document.forms["frm1"]["fname"].value + "!")
}
</script>
</head>
<body>

What is your name?<br />
<form name="frm1" action="submit.htm" onsubmit="greeting()">
<input type="text" name="fname" />
<input type="submit" value="Submit" />
</form>

Hope this helps

fobos 19 Posting Whiz in Training

Where is your javascript code? this is HTML, if you have a problem with that, please post in the HTML section.

fobos 19 Posting Whiz in Training

try using jquery.jstore

fobos 19 Posting Whiz in Training

Im testing it in chrome and its working just fine, but firefox is a no go. what browser are you using?
Here is the link to Github html5slider for firefox. Just remember to have some sort of code to identify the browser so it can properly be displayed.

Click Here

fobos 19 Posting Whiz in Training

You will probably have to use DOM and get the elements id, like in javascript. I had the same problem in javascript, but i figured it out using jQuery and its simple.

Click Here

fobos 19 Posting Whiz in Training

do any values show up in the URL when you hover over it?

fobos 19 Posting Whiz in Training

well then you need to post the code for the other page. why post a code if you didnt have a problem with it

fobos 19 Posting Whiz in Training

well all i can see so far is that when you click on the link, you get a url that only has 1 variable.

post.php?id=1hoteljoes

try

<a href=\"post.php?id=".$arr['id']."&type=".$arr['type']."&name=".$arr['name']."\">
fobos 19 Posting Whiz in Training

Dude,
if you want to sort by desc, or asc, then just have an html option where the values are <?php self...?sort=asc

then have your php code

if(!isset('something')) {
mysql code ORDER BY ASC
}

check out www.w3schools.com. really good play to begin learning.

fobos 19 Posting Whiz in Training

I figured it out. The if statement wasnt what i was supposed to be using. jQuery has its own if

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var x = $("td").filter('[class="ms-vb2"]');
    alert($('td:contains("link")').length);
});
</script>
</head>
<body>
<table id="catlist_ul">
    <tr><td class="ms-vb2">lin</td></tr>
    <tr><td class="ms-vb2">link</td></tr>
    <tr><td class="ms-vb2">link</td></tr>
    <tr><td class="ms-vb2">link</td></tr>
    <tr><td class="ms-vb2">link</td></tr>
</table>

</body>
</html>

Thanks for the help guys.

fobos 19 Posting Whiz in Training

So you want to use an input box to navigate through pages?

diafol commented: That was some feat to make sense of that! :) +14
fobos 19 Posting Whiz in Training

You could try making a script and insert it on all your pages. In php, you would have to write the session on top of every page, so why not include a script on every page.

<script type="text/javascript">
$(document).ready(function(){
  $("a").click(function(){
    // your global variable
    var z = "cheese";
    //gets the href attribute
    var x = $(this).attr("href");
    //go to links location with variable
    location.href=x+z;
  });
});
</script>
<body>
<a href="www.google.com/#q=">click me</a>
</body

Hope this helps

fobos 19 Posting Whiz in Training

yeah

fobos 19 Posting Whiz in Training

Ok here is a better clarification:
Say i have 3 td's with different words in them:

<table>
    <tr>
        <td class="ms-vb2">links</td>
        <td class="ms-vb2">link</td>
        <td class="ms-vb2">link</td>
    </tr>
</table>

I want jQuery to count the words that i specifiy. Like if i wanted to know how many times dog shows up. The output should be
Link: 2
Links: 1

What i was trying to do is

$(document).ready(function(){
    //Find all the td's that have the class ms-vb2
    var totaltr = $(".ms-vb2"); 
    // Now, if that class has the word "link" in the innerHTML, it count it.
    if(totaltr.html()== "link"){
    //Print it
        var htmlBlock = "<strong>" + totaltr.length + " ITEMS</strong>";
        totalProductList.innerHTML += htmlBlock;
    }
});

What the problem is, if all the td's have the same word in it (like link), it count 3, but if i change one like in the first reference, it disappears and it doesnt work. I thought using the if statement would only count what i was looking for, like in PHP or something. Is this better clarification?

fobos 19 Posting Whiz in Training

Yes i know that, i want to be able to still add if a td has a different word in it

fobos 19 Posting Whiz in Training

Hello,
i have this piece of code that counts the number of words in a td based off the class of the td. It works find if all the words inside the td's are the same, but if i change one, it doesnt work.

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    var totaltr = $(".ms-vb2")
    if(totaltr.html()== "link"){
        var htmlBlock = "<strong>" + totaltr.length + " ITEMS</strong>";
        totalProductList.innerHTML += htmlBlock;
    }
});
</script>
</head>
<body>
<table id="catlist_ul">
<tr><td class="ms-vb2">link</td></tr>
<tr><td class="ms-vb2">link</td></tr>
<tr><td class="ms-vb2">link</td></tr>
<tr><td class="ms-vb2">link</td></tr>
<tr><td class="ms-vb2">link</td></tr>
<div id="totalProductList"></div>
</table>

</body>
</html>

If i change on of the link to links, it doesnt write it? what can be going wrong?

fobos 19 Posting Whiz in Training

I could be wrong, but unlsess the input fields have data in them before the document loads, then its just going to get the blank values when the document loads. Try putting all that in a function, so when you click submit, it will get the data from the input fields and then submit them.

fobos 19 Posting Whiz in Training

Dont use the $_GET statement in Biiim statment, use $_POST. The only time you use GET statement, is if you are submitting your form using a url. in this case you would need to have the form method="GET", but your using method="POST"