fobos 19 Posting Whiz in Training

Ok from what i see, you are calling a function from a button. The only problem is that the function itself is missing. do something simple like

function Cal() {
    alert("hi");
}
fobos 19 Posting Whiz in Training

have you tried <a href='$_SERVER?page=$j'<u>$j</u></a>

fobos 19 Posting Whiz in Training

i forgot to add the ' ' to it in the values

fobos 19 Posting Whiz in Training

Try this.

$date = date("Y-m-d H:i:s"); 
INSERT INTO equardIPs (start) VALUES(" . $date . ")
fobos 19 Posting Whiz in Training

Sweet the dump is what i needed

fobos 19 Posting Whiz in Training

lol, i was just reading that, but didnt know how to empliment that. ill give it a try. Thanks for the help. Ill go ahead and mark this solved.

fobos 19 Posting Whiz in Training

I would suggest using $_SESSSION and so forth. And just like any webstie that has a login, just have a timeout or log out script to destroy the session.

fobos 19 Posting Whiz in Training

Sweet arrgh,
Thanks for that one. Well i got it working just like in the example that was provided where i can upload and download.
My only question is, how do i get the Filename and File Extension? Reason is, because now i dont have to manually specify the name and extension or just restrict the upload to certain types of files.

fobos 19 Posting Whiz in Training

Hey guys,
i have looked all over the web on how to upload a file to MySQL database and retrieve using coldfusion. I know i can do it in PHP, but im not using that anymore. Is there a script or some place that someone can point me so i can learn? I know i can move the file to a location and store the link, but was hoping to find a way to store it in MySQL?

Thanks for any help.

redo22 commented: fuck +0
fobos 19 Posting Whiz in Training

Well i did avoid this all together, because i didnt know how to do it this way. Basically i used 3 query statemets vice a function. I just wanted to learn different ways on how do things so im not tied down to one way. Ill try what you have posted, but if sql injection is a major factor then ill just forget about it and use what i have. I really appreciate the help that you provide for me everytime i post a problem.

fobos 19 Posting Whiz in Training

Hello,
well i have a problem, i was wondering if there is a way to return a query in a function?
This is what i have so far, but i get an error.

<cffunction name="select_query" access="public" returntype="any">
    <cfargument name="as" type="string" required="yes">
    <cfargument name="status" type="string" required="yes">
    <cfset var sql = "">
    <cfset sql = "SELECT count(status) AS " & ARGUMENTS.as & " FROM table WHERE status = '" & ARGUMENTS.status 7 "'">
    <cfquery name="get" datasource="Database">#sql#</cfquery>
    <cfreturn get>
</cffunction>

<cfoutput>#select_query('New','New')#</cfoutput>

What im trying to do is return a number from the count statement, but im getting an error saying "You have an error in your SQL syntax; use right syntax near 'new''' at line 1. I didnt know why it has 3 apostrophes after new, so i tried deleting the apostrophes in the sql statement and i got the same error but now it had 'new' not 'new'''. How can i do this? Thanks for any help.

fobos 19 Posting Whiz in Training

I know this works in IE, because i use it all the time. Here is my code.
Page1 is the main page with the iframe on it. The iframe ID will be "load_frame".

Page1

<html>
<head>
<script type="text/javascript">
function load_it(url) {
    document.getElementById("load_frame").src = url;
}

function adjust_iframe(h) {
    if(h==0)
    document.getElementById("load_frame").src = document.getElementById("load_frame").src;
    document.getElementById("load_frma").style.height = h;
    window.scrollTo(0,0);
}
</script>
</head>
<body>
Auto height Div<a onclick="load_it('flashpage.htm')">load page</a>
<iframe id="load_frame" marginheight="0" marginwidth="0" border="0" src="" frameborder="0" width="100%" name="load_frame" scrolling="no">
</body>
</html>

for the page being loaded in the iframe. We will call it flashpage.htm. Just put this in the head section.

<script type="text/javscript">
funtion load_page() {
    parent.adjust_iframe(document.body.scrollHeight);
}
</script>
<body onload="load_page()">

This way when you click on the link, it will load the page into the iframe and the page getting loaded will call the function "load_page" and will call the function on the main page to set the iframe height to the body height on the page being loaded. The only downfall is, if you have set the flash to 100% for height and width then you will have to manually set the iframe height. Other than that, this will work.

fobos 19 Posting Whiz in Training

Try this.. Your code seems fine, but i would question the "." in $target = "../pictures/".$imagename; before $imagename.

if(isset($_POST["input_name"])) {
    if (file_exists("../pictures/" . $_FILES["file"]["name"])) {
        echo $_FILES["file"]["name"] . " already exists. ";
    } else {
        move_uploaded_file($_FILES["file"]["tmp_name"],"../pictures/" . $_FILES["file"]["name"]);
        echo "Stored in: " . "../pictures/" . $_FILES["file"]["name"];
    }
}
fobos 19 Posting Whiz in Training

post your error please

fobos 19 Posting Whiz in Training

For 1), just create a php, cf, or asp page and call it swf_page.ext. Next set the CSS body, html, and swf height + width to 100%. Then embed the swf object. When you lauch the page, it should take up the whole screen. next make it where the params get what is passed in the url.

For 2), you will have to pass the parameters using a link. So we will call this main.html. create an iframe (width 300, height 300) and a side nav with a link.

<script type="text/javascript">
function pass_param(param1) {
    document.getElementById("iframe").src = "swf_page.ext?height="+param1;
}
</script>
<a onlick="pass_param('100')">Adjust height to 100</a>

Or if you want to use more than one parameter.

<script type="text/javascript">
function pass_param() {
    var param1 = document.getElementById("input1").value; 
    var param2 = document.getElementById("input2").value;
    document.getElementById("iframe").src = "swf_page.ext?param1="+param1+"&param2="+param2;
}
</script>
<form>
<input type="text" id="input1">
<input type="text" id="input2">
<a onlick="pass_param()">Submit</a>

i hope this helps

fobos 19 Posting Whiz in Training

instead of

<a href="#" class="leftlinks" onclick="updateParent(control)" id="2" value="2">CLICK HERE</a>

the value needs to be in the function on the link, because the function in the script requires a value.

<a href="#" class="leftlinks" onclick="updateParent(2)" id="2" value="2">CLICK HERE</a>

Plus, just try to use

function updateParent(control) {
    window.opener.location.href="index.php?menukey="+control;
}
fobos 19 Posting Whiz in Training

If you want it to check to see if the username is already in use, then you would have to use server side language ie..asp,cf, or php to check to see if the username has already been used by accessing the database and running a query.

fobos 19 Posting Whiz in Training

Ok my bad on the post, i wasnt writing to you. Anyways, you have to use the substring method. Sorry for the above post.

fobos 19 Posting Whiz in Training

You would have to use the replace string.

var myString = "this is a string\n that needs \n\n to be on a newline";
var myString2 = myString.replace(/\n/g, "<br>");

document.write (myString2);
fobos 19 Posting Whiz in Training

just use the delete method using the rows id

mysql_query("DELETE FROM table WHERE id='1'");
fobos 19 Posting Whiz in Training

I guess i should post what i use now, for others to view.

<cffunction name="convert" access="public" returntype="string">
    <cfargument name="latitude" required="yes" type="any">
    <cfargument name="longitude" required="yes" type="any">
    <cfset var lat = "">
    <cfset var long = "">
    <cfset lat = #replace(ARGUMENTS.latitude,".","")#>
    <cfset long = #replace(ARGUMENTS.longitude,".","")#>
    <cfset lat.substring(2,4)&"."&lat.substring(4,len(lat))>
    <cfset long.substring(1,3)&"."&long.substring(3,len(long))>
    <cfset coord = lat&","& long>
    <cfreturn coord>
</cffunction>
<cfoutput>#convert("E12345.678","N1234.567")#</cfoutput>
fobos 19 Posting Whiz in Training

If this is a registration form, try checking it against the database using a different method.

<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con) {
  die('Could not connect: ' . mysql_error());
}

mysql_select_db("my_db", $con);

$result = mysql_query("SELECT username FROM users");

while($row = mysql_fetch_array($result)) {
    //if the username matches any username in the database, return it false. Else return insert code.
    if($row['username'] == $_POST['username']) {
        echo "Username Already In Use";
    } else {
        // Insert Code
}

mysql_close($con);
?> 

I havent used PHP in a while, but something like this should work.
fobos 19 Posting Whiz in Training

eswar.aspire,
First off, you need to post your questions in the correct forum. This is purely Javascript not PHP, because your asking a question that has no PHP in it.
Secondly, what you need to have in your parent page is a function that will control the iframe sources.

function load_left(url) {
    document.getElementById("menu").src = url;
}

In the "login_reg" page that gets loaded in the "page_load" iframe, you need to impliment this with the jquery, so when you click submit it calles the function on the parent frame and loades the "menu" iframe with the desired page.

$("#login_form").submit(function() {
    parent.load_left('../pub@lic_profile/@_profile/all_@_all/horizontal_menu/flashmo_114_horizontal_03.swf');
});
fobos 19 Posting Whiz in Training

Thanks divin757,
Your code helped get me started, but then i noticed that it didnt output the whole thing to include the period. So i just changed the value of 4 to 3 and added str to the substrings and length.

var str = "0222232";
document.write(str.substring(0,3) + "." + str.substring(3, str.length))

Again thanks alot.

fobos 19 Posting Whiz in Training

Good day all,
well i have been searching the web and i cannot find an answer to my question. First off i dont know if i should post this here or in the Javascript section because i am a coldfusion user and didnt know if javascript does this. Second my problem is i want to add a "." after the 3rd character or letter. Ex.

var str = "0222232"
This is where the function would come in to add a . after the 3rd number. So the output would be 022.2232

Is this possible? I normally show code, but i wouldnt even know where to start. Thanks for the help.

fobos 19 Posting Whiz in Training

Wow, i cant stop laughing how i overlooked doing it that way. I really appreciate the help Airshow.

fobos 19 Posting Whiz in Training

Hello all,
well i have a problem, but it sorta works. Here is my code.

var toggleState = 0
function toggleMe() {
    if(toggleState == 0) {
        alert("Checked");
        toggleState = 1;
    } else {
        alert("Unchecked");
        toggleState = 0;
    }
}

HTML

<input type="checkbox" onclick="toggleMe()" />Toggle me
<input type="checkbox" onclick="toggleMe()" />Toggle me

The problem is that when i check box 1, i get an alert. When i click it gain, nothing. Now when i click it a third time for it to uncheck, then i get the alert and it works fine where i can do it on and off with the alerts. The only thing is now its backwards. Now, if i check the first one, alert works. If i do the second one while the first one is checked then again nothing, then it works on the 2nd click. I have tried if(this.attribute = "checked") { do something} else { if(this.attribute = "unchecked") { alert unchecked} but nothing. Im just really confused.

fobos 19 Posting Whiz in Training

Instead of using $result multiple times, try using $result, $result2, $result and seee if that works

fobos 19 Posting Whiz in Training

Yeah

fobos 19 Posting Whiz in Training

try using the if else statement.
ex.
if level = 0 use unchecked box else use checked box

fobos 19 Posting Whiz in Training

Ok, well in your up.php you have variables in your post

$p_level9 = $_POST['$u_level9'];

Should be

$p_level9 = $_POST['u_level9'];
fobos 19 Posting Whiz in Training

First off, is the form being populated?

fobos 19 Posting Whiz in Training

Honestly, i think the best way to do this is have them sign up to see some of the things you have to offer. If they want to get the full features, have them use paypal to give you a payment for so many weeks or whatever. Once the transaction is complete, just give them rights to see the features that they have paid for.

fobos 19 Posting Whiz in Training

Well thats what i mean, just use the code that is in the spry and tailor it to what you want. Im sure you knew that anyways about the Spry Menu Bar..lol.

fobos 19 Posting Whiz in Training

If you are using dreamweaver, you can use the Spry Menu Bar that is provided with the feature that you want.

fobos 19 Posting Whiz in Training

Well you have the right idea.. sort of with your if statements, except (in my opinion) they would be better in the checkbox itself. Right now when you use the if else, you are not assigning a variable to the "true" statement. Because of that you cannot reference it in the checkbox. For the easiest solution, try this.

echo"<tr align='center'>";
while($row = mysql_fetch_array($result2))  { 
    echo"<input type='hidden' name='fitem' value='$row[item]'>";   
    echo"<td>$row[item]</td>";

    if($row['level1']=="1") {
        echo "<td><input type='checkbox' name='checkbox1' value='1' checked='checked' /></td>";
    } else {
        echo "<td><input type='checkbox' name='checkbox1' value='0' /></td>";
    }
}
echo "</tr>";

Then when the user clicks the submit button

if(isset($_POST['submit'])) {
 //Your update code
}

By the way, on your update, you have

$fpq= "UPDATE ....";

and you use this

mysql_query($query);

What is the "$query" variable too?

fobos 19 Posting Whiz in Training

Im just going to try and get the ball rolling with "hopefully" other people helping. Well one thing i do know that you shouldnt put a name on a jquery function because thats the whole point of the structure. Im im wrong, hey oh well.

You

$("#someid").mouseleave(function animatebackgroundsout() {

Should be

$("#someid").mouseleave(function() {

Ummm... if that doesnt work, what IE are you using? If its 8 or so, there might be a compatibility button by the refresh button. See if that works when you use it? Well just trying to narrow down the problems. Excuse me if you already know this, just never know when you reply to someone.

fobos 19 Posting Whiz in Training

Did you write this or copy it. If you copied it, then you need to learn javascript and stop asking people what you want. We are here to fix problems that people have on there codes, not code that people copied and have no idea how it works. Sorry for being rude.

fobos 19 Posting Whiz in Training

Use Navicat for MySQL

fobos 19 Posting Whiz in Training

Here is a good tutorial on how to insert values into a database and how to use php mail function

http://www.w3schools.com/php/default.asp

fobos 19 Posting Whiz in Training

Hello all,
Ive been stuck and i dont know how to add a .mdb or .accdb to my "Data & Service". Currently i am using CF9. If its not too much trouble, i would like to know how to do both if this is possible?

fobos 19 Posting Whiz in Training

try www.dhtmlx.com
that is what i use and it is wonderful.

fobos 19 Posting Whiz in Training

Well thats where you need to start reading my friend. i gave you the basics, now its time for you to learn. By the way the "name" in the input was just something that i written in there, change it to your table row name. Also, all of that would go onto 1 page.

fobos 19 Posting Whiz in Training

You have this

echo "<td>" . 'Please <a href="/view.php">try again</a>.' . "</td>";

Try this

echo "<td>Please <a href=\"view.php?id=".$row['id']."\">try again</a></td>";

What this will do is when the user clicks on the link, the link will contain the id to the row in the database. Then when it goes to try.php, just use the $_GET in your mysql statement to display the row.

fobos 19 Posting Whiz in Training

Just to understand, this will be for all weeks or in a certain time frame? What is the output that your getting right now?

fobos 19 Posting Whiz in Training

ok, first thing is your using $result twice, basically you have colliding variables. second thing is that your insert statement is incorrect. Whenever you use an insert statement you need to define the table fields, then use the "VALUES" to insert into the table fields.

$name=$_POST["name"];
$addressline1=$_POST["addressline1"];
$addressline2=$_POST["addressline2"];
$email=$_POST["email"];

$con = //Connection;
mysql_select_db("db", $con);
$sql = "INSERT into table(name,addressline1,addressline2,email) VALUES('$name','$addressline1','$addressline2','$email')";
if(mysql_query($sql,$con)) {
    die('Error: ' . mysql_error());
} else {
    print "name=$name addressline1=$addressline1 addressline2=$addressline2 email=$email ";
}

On the database display, you cannot use 0 or 1 or 2 or 3. define them from your table fields. Also, you have to use fetch_array not fetch_row. A really great website is www.w3schools.com

fobos 19 Posting Whiz in Training

Could you explain more on the problem. Ex, can you not see it in the browser or what?

fobos 19 Posting Whiz in Training

No your dynamic or static ip address that is givin from your internet provider. ex.. 123.456.789.012

fobos 19 Posting Whiz in Training

thats why. i used to have the same problem when i launched it in http://localhost/. Try launching it with the site name or ip address and this shouldnt happen

Zexsz commented: I didn't understand immediately, but it fixed my problem. +0
fobos 19 Posting Whiz in Training

when you launch the webpage in the browser, is it
http://localhost/ or
http://yoursite.com/