263 Posted Topics
Re: Try this [CODE] <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // … | |
Re: [CODE=PHP] while($row = mysql_fetch_array($result) { echo "<img src='".$row['filepath']."'>"; echo "<br>"; echo "<a id='".$row['id']."' value='".$row['id']."' onclick='getrating();'>Likes: ".$row['likes']."</a>"; echo "<br>"; } [/CODE] [CODE=javascript] <script type="text/javascript" > function getrating(){ var x = document.getElementById("<?php echo $row['id']; ?>").value; alert(x) } </script> [/CODE] ![]() | |
Re: go to w3schools.com and go to the php section and start learning. Then come back with what you have. | |
Re: Also, its bad practice to write your php tags in shorthand. | |
Re: This should help [URL="http://www.w3schools.com/ajax/default.asp"]http://www.w3schools.com/ajax/default.asp[/URL] | |
Re: if you have page a.htm. wich is the parent page with 2 iframes, you type in iframe a, and it reloads iframe b with the new text. is this your question? And you can only write in the header? | |
Re: MARK SOLVED if this is solved | |
Re: Did you set up your SMPT for the email so it knows how to send it? smpt: smpt_port: | |
Re: its your localhost. Either 127.0.0.1 or your computer IP address | |
Re: You have an error on line 11, you need to add ">" to then end of the image tag. Also try this. [CODE=PHP] ob_start(); session_start(); if(!isset($_SESSION['Username'])) { echo "<a href='http://www.test.com/signup.php'><img src='/images/register.png' alt='Please Register'/></a>"; } else { echo "<a href='http://www.test.com/thanks.php'><img src='/images/vote.png' alt='Vote'></a>"; } [/CODE] | |
Re: I could be wrong with the below statement in green. [CODE] date_default_timezone_set('America/New_York'); include 'connect.php'; $day = date('l'); $time = date('H:i:s'); [COLOR="Green"]// How to compare times if you do not include it in the select statement? You only have [COLOR="Red"]ID,ID,name[/COLOR].. No time or day is selected, so sql is only going … | |
Re: In my opinion, i think O'Reilly has the best books that cover a wide variety of subjects and things. Here are a couple that you would enjoy [URL="http://docstore.mik.ua/orelly/webprog/php/index.htm"]Programming PHP[/URL] [URL="http://docstore.mik.ua/orelly/webprog/pcook/index.htm"]PHP Cookbook[/URL] Also, php.net is a good reference and has a bunch of things. | |
Re: try using <?php $_SERVER['SERVER_ADDR']?>/admin/validateLogin/ in your form action. | |
Re: Try this website [URL="http://arc.id.au/JsAnimation.html"]http://arc.id.au/JsAnimation.html[/URL] | |
Re: Hi, found this on the web and tested it. [CODE] <script type="text/javascript"> <!-- function formatOutput(num) { if (num > 10) return parseInt(num); return num; } function validate(num, name) { if (isNaN(num)) { alert("Invalid input for " + name); return 1; } return 0; } function distance() { var lat_1 = … | |
Re: Your going to have to post more of your codeing, because on line 1 [CODE=PHP] $appr2 = mysql_query("SELECT from_date FROM mrfs WHERE `mrf_id`='[COLOR="Red"]$row[0][/COLOR]'") or die (mysql_error()); [/CODE] im guessing you are running a sql query prior to that one? If you dont mind i have a suggestion [CODE=PHP] $result = … | |
Re: if your getting Hello World '; ?> it means that its echoing part of of the string. if it wasnt working, 1) would be able to view the php page, 2) it would write it just as you have it <?php... ?>. just write it, but try phpinfo() first [CODE] … | |
Re: See if you can connect using this? [CODE] /* connect to gmail */ $hostname = '{imap.gmail.com:993/imap/ssl}INBOX'; $username = 'someone@gmail.com'; $password = 'yourpassword'; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error()); [/CODE] | |
Re: Mark it solved BilalAKhan!! Its down near the bottom by the quick reply. | |
Re: Could your question be any broader? Try google. [url]http://www.w3schools.com/js/default.asp[/url] | |
Re: [CODE] <html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("[COLOR="Red"]someone@example.com[/COLOR]", "$subject", $message, "From:" . $email); echo "Thank you for using our mail form"; } else //if "email" is not filled out, … | |
Re: Here are some questions that may be answered: 1) Have you tried booting in safe mode? 2) After you reformated, were you able to log in? 3) Did you install a program, then the BSOD happened after restarting? 4) Maybe there is a hardrive failure or bad OS disc? Hopefully … | |
Re: try puting this in pageb.php function history(){ parent.checkHistory(); } <body onload="history()"> | |
Re: In order to do this, we have to join the table when we execute the query. [CODE=PHP] <?php //Connection $query = "SELECT film.filmname, review.filmreview FROM film, review WHERE film.filmid= review.filmid"; $result = mysql_query($query) or die(mysql_error()); // Print out the contents of each row into a table while($row = mysql_fetch_array($result)){ echo … | |
Re: If you installed MySQL, then you should have been prompted to insert a password. If it comes with WAMP, try using id = admin password = password or just id = admin, password = "BLANK". | |
Re: How is your database set up.. Are you storing the picture in a BLOB or locally? | |
Hello everyone, i had a question on how to pull certain content from a website using PHP and cURL and dislay it on a page? So far from the web, this is all i was able to find out, but this just saves the coding into a text document. Lets … | |
Re: Thanks for the help cereal. i was trying to echo the website into $f, then pull the div by id. 1, how do i get the web content into a variable.. like $f = geturlcontent? then call the div. 2, can i use $t = $dom->getElementById($f); to get the div … | |
Re: have you tried <a href='$_SERVER['PHP_SELF']?page=$j'<u>$j</u></a> | |
Re: Try this attachment. It will tell you what port is being used and whats not. Next time, please post this in the correct forum. This has nothing to do with PHP, this is more of a software thing. On another note, google XAMPP. This is a really great bundle that … | |
Re: ajijacobm, the only way you are going to be able to use mysql with dynamic coding is by using server side code. HTML and javascript will not get what you want. You will have to use ASP, Coldfusion, PHP.. etc to achieve the results that you want. Now if you … | |
Re: 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 [CODE=javascript] function Cal() { alert("hi"); } [/CODE] | |
Re: Here is a link to what you are looking for. [URL="http://www.devarticles.com/c/a/JavaScript/Building-a-Dynamic-Menu-with-CSS-and-JavaScript-part-1/"]Click Here[/URL] | |
Re: Try this. [CODE] $date = date("Y-m-d H:i:s"); INSERT INTO equardIPs (start) VALUES(" . $date . ") [/CODE] | |
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 … | |
Re: I would suggest using $_SESSSION['first_name'] and so forth. And just like any webstie that has a login, just have a timeout or log out script to destroy the session. | |
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. [CODE] <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 = … | |
Re: 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 [CODE=HTML] <html> <head> <script type="text/javascript"> function load_it(url) { document.getElementById("load_frame").src = url; } function adjust_iframe(h) { if(h==0) … | |
Re: Try this.. Your code seems fine, but i would question the "." in $target = "../pictures/".$imagename; before $imagename. [CODE=PHP] 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"]; } } [/CODE] | |
Re: You would have to use the replace string. [CODE=JAVASCRIPT] 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); [/CODE] | |
Re: 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. | |
Re: 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 … | |
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 … | |
![]() | Re: instead of [CODE] <a href="#" class="leftlinks" onclick="updateParent(control)" id="2" value="2">CLICK HERE</a> [/CODE] the value needs to be in the function on the link, because the function in the script requires a value. [CODE] <a href="#" class="leftlinks" onclick="updateParent(2)" id="2" value="2">CLICK HERE</a>[/CODE] Plus, just try to use [CODE] function updateParent(control) { window.opener.location.href="index.php?menukey="+control; } … ![]() |
Re: just use the delete method using the rows id [CODE] mysql_query("DELETE FROM table WHERE id='1'"); [/CODE] | |
Re: If this is a registration form, try checking it against the database using a different method. [CODE] <?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 End.