I want to know if its possible to store php variables in mysql database i currently have a text field which stores the value <div class="row-2"> <div class="titles"> <?=$config['slogan']?> </div> </div> this is the slogan for the website that is in anther table which is got before this - if i try and echo all that out it puts html comments around it so i get <!--$config['slogan']--> if i use str_replace i get nothing from it - is it actually possible to change that into PHP without to much fuss or do i have to find anther way?

Member Avatar
Member Avatar
+0 forum 8

I have a online photo gallery and when you hover over a image an edit button appears that opens up a jquery prompt box in which you enter the caption after this has been entered i have the following code var caption=prompt("Please enter new caption"," "); if (caption!=null) { var link = "?id="+ $(this).parents('.thumbnail').attr('id') + "&c=" + caption; $.post("../photo_c.html"+link); //alert($(this).parents('.thumbnail').attr('id')); $("#loaddiv").slideUp(300).delay(800).fadeIn('3000'); } This should refresh the div but it wont it flashes but the PHP caption that comes from the database wont change even tho the script at photo_c.html is changing it and working, i have been informed to change …

Member Avatar
Member Avatar
+0 forum 1

Hello, im after merging two strings togther from a for each loop. here is what i have [CODE] foreach($html->find('div[class=product_description]') as $post) { $desc_html_puller = preg_replace("/<.*?>/", "", $post); echo $post } [/CODE] that does the trick but i want to use the $post variable out of the for each loop, but when i do it only brings the first variable out

Member Avatar
Member Avatar
+0 forum 1

Hello, i have managed to get hold of social engine and trying to edit the profile script to create a friends list like facebook instead of it saying i have so many friends, This is my first time using smarty so im still learning this is my profile.php [CODE] $page_id = $_GET['user']; $sql = "SELECT * FROM se_friends WHERE friend_user_id1 = '$page_id' AND friend_status = '1' LIMIT 0,9"; $mysql = mysql_query($sql) or die (mysql_error()); $all_friends = array(); $all_info = array(); while ($rows = mysql_fetch_array($mysql)) { $friend_id = $rows['friend_user_id2']; $query = "SELECT * FROM se_users WHERE user_id = '$friend_id'"; $mysql = …

Member Avatar
Member Avatar
+0 forum 3

Hello, im unsure how to fetch a database row that includes php, i have a row in my database that displays a marquee saying 'welcome $username' i have connected to the database but the php on page shows 'welcome $username' how would i get it to state the username instaed of $username [CODE] $query = mysql_query("SELECT * FROM marquees"); $results = mysql_fetch_array($results); $home = $results['home']; echo $home; [/CODE]

Member Avatar
Member Avatar
+0 forum 7

Hello im creating a small social network from scratch and struggling with the newsfeed i have the newsfeed loaded through ajax then page loaded remotly i have a timeago jquery script and the timeago script is not working, but when i get rid of the ajax auto refresh and use the code without the auto refresh it works here is the coding that wont work home.php [CODE] <script type="text/javascript"> function Ajax(){ var xmlHttp; try{ xmlHttp=new XMLHttpRequest();// Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("No AJAX!?"); …

Member Avatar
Member Avatar
+0 forum 2

hello, on my website's homepage/login page im after a newsfeed like facebooks. If its your first time to the site you will view a random few post's from people, But if your a member and have signed up it will just show your friends. currently i have a function [CODE] function friends_streams ($uid) { $res = mysql_query("SELECT * FROM friends WHERE uid='$uid'"); while ($row = mysql_fetch_array($res)) { $fids[] = $row['fid']; } if (is_array($fids)) { array_push($fids, $uid); foreach ($fids as $value) { $my_in = mysql_query("SELECT * FROM accounts where id = '$value' ORDER BY id DESC"); $my_info = mysql_fetch_array($my_in); // output …

Member Avatar
Member Avatar
+0 forum 1

i have a array which contains then numbers 1,2,3 etc... i want to connect to my mysql database and collect the information from the databse where the id column is = either 1 / 2 / 3 etc... how would i go about this?

Member Avatar
Member Avatar
+0 forum 1

Hello i am creating a small forum and having trouble with the user sign up form. i have the start of a sign up form on the index page then that jumps to the sign up page with more info, e.g... index.php [CODE] <form action="signup.php" method="post"> name: <input type="text" name="name" > email: <input type="text" name="email" > <input type="submit"> </form> [/CODE] signup.php [CODE] <?php $name = $_POST['name']; $email = $_POST['email']; ?> <form action="signup.php" method="post"> name: <input type="text" name="name" value="<?php echo $name ?>" > email: <input type="text" name="email" value="<?php echo $email ?>" > confirm email: <input type="text" name="email2" > password: <input type="password" …

Member Avatar
Member Avatar
+0 forum 1

Hello i am trying to create a script that will allow for the user to click a link and pop up page opens up with the content from the same page e.g [CODE] <?php $option = $_GET['option']; ?> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function topWindow(){ popup = window.open("page1.php?option=<?php echo $option; ?>","scrollbars=no"); } // End --> </SCRIPT> <?php // list echo "<a href=$PHP_SELF?option=1 onclick=\"topWindow()\">Link 1 </a>"; echo "<a href=$PHP_SELF?option=2 onclick=\"topWindow()\">Link 2 </a>"; echo "<a href=$PHP_SELF?option=3 onclick=\"topWindow()\">Link 3 </a>"; if ($option == 1) { // show this data in pop up } if ($option == 2) { // show this data in pop …

Member Avatar
Member Avatar
+0 forum 5

i need a piece of code to break down the data brought in from the MYSQL database im creating a small forum type on my website but with my layout if the user writes 5 lines it shows it all on 1 line and shows the bottom scroll bar, i under stand that there is a for statement that will do it but unable to think of what the code is can any 1 help me out on this, thank you

Member Avatar
Member Avatar
+0 forum 7

im trying to create a form that redirects the user to anther page and also stores the information in the database. here is the code [CODE]<?php mysql_connect("localhost", "DBname", "Password") or die(mysql_error()); mysql_select_db("DBname") or die(mysql_error()); // Retrieve all the data from the table $result = mysql_query("SELECT * FROM players") or die(mysql_error()); // store the record of the "player" table into $row $row = mysql_fetch_array( $result ); ?> </div> <table border="0" cellpadding="0" cellspacing="0" width="600"> <tr> <td colspan="3"></td> <td></td> </tr> <tr> <td colspan="3"></td> <td></td> </tr> <tr> <td colspan="3"></td> <td></td> </tr> <tr> <td colspan=3 align=center> <form action="main.php" method="post" name="form"> Enter Username: <input type="text" name="username" …

Member Avatar
Member Avatar
+0 forum 9

Hello i am after creating a javascript alert box with a text input and a submit button that when the submit button is pressed the text field will save its self into a php variable that will then be inserted into the a database. here is the code i have so far [CODE] if($Petname == '') { ?> <body onload='javascript: jQuery.facebox("<div align=\"center\">Enter your pets Name:&nbsp;<input type=\"text\" name=\"pet\" ><br /><br /><input type=\"submit\"></div> ");'></body> <?php } [/CODE] how would i retrieve the variable from the javascript and store it into php?

Member Avatar
Member Avatar
+0 forum 2

Hello all im am after a script that allows for a drop down menu that allows the user to select a item and store that item into the database currenty i have [CODE] //all database stuff here $player_chr_pet = $_POST['chr_pet']; $chr_health = '10'; // var set at 10 incase error and user cannot select what pet // if form is submited insert data to database code here $html_form = " <select name=\"chr_pet\"> <option value=\"Pig\">Pig</option> <option value=\"Dragon\">Dragon</option> <option value=\"Cow\">Cow</option> <option value=\"Horse\">Horse</option> <option value=\"Bear\">Bear</option> <option value=\"Cat\">Cat</option> <option value=\"Zebra\">Zebra</option> <option value=\"Tigar\">Tigar</option> <option value=\"Chicken\">Chicken</option> <option value=\"Elephant\">Elephant</option> </select> "; [/CODE] Now i need to know …

Member Avatar
Member Avatar
+0 forum 2

Hello, i was searchin for some fancy flash effects for my website and come accross this website [URL="http://agencynet.com/#/home/"]http://agencynet.com/#/home/[/URL] i am unsure what this website is coded in and would like to know. and also what skills are needed to create a website like this? im not after creating a massive website like that one in the link just a very small example to see how its done, Thank you

Member Avatar
Member Avatar
+0 forum 2

Hello, i was searchin for some fancy flash effects for my website and come accross this website [URL="http://agencynet.com/#/home/"]http://agencynet.com/#/home/[/URL] i am unsure what this website is coded in and would like to know. and also what skills are needed to create a website like this? im not after creating a massive website like that one in the link just a very small example to see how its done, Thank you

Member Avatar
Member Avatar
+0 forum 2

if i use this code page1.php [CODE] <form action="" method="post" > First <input type="text" name="first" /> last <input type="text" name="last" /> <input type="submit" /> </form> <a href="page2.php?first=<?php echo $_POST['first'] ?>&last=<?php echo $_POST['last'] ?>">click here</a>[/CODE] page2.php [CODE] <?php session_start(); define ('first', $_GET['first']); define ('last', $_GET['last']); ?> <p>information submitted thank you, <a href="page3.php">click here</a></p> [/CODE] page3.php (the page users see) [CODE] <?php include_once 'page2.php' ?> <p>First = <?php echo defined (first); ?> </p> <p>Last = <?php echo defined (last); ?> </p> [/CODE] will people who vist page3.php be able to see what information i put into page1.php ?? also just tried using …

Member Avatar
Member Avatar
+0 forum 10

Hello, i am trying to create a script that will allow me to visit a page and enter some information and when i click submit it will send that data to anther page, i have managed to do it with a http link, but my question is how to keep the writing on that page, ? im currently using test1 [CODE]<!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" /> <title>Untitled Document</title> </head> <body> <a href="test1.php?first_name=Shaun&last_name=Morgan">Test Page 1</a> </body> </html>[/CODE] and test1.php [CODE]<!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 …

Member Avatar
Member Avatar
+0 forum 2

Hello i am after a piece of code that will change my ip address every 30 seconds, i have no idea were to start so any help will be appricated thank you

Member Avatar
Member Avatar
+1 forum 2

Hi there, I am trying to use a login and a contact form on one page, but im struggling with the php context [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>my webpage</title> </head> <body> <?php $user = 'admin'; $pass = 'admin'; if ($user != $_POST['username'] || $pass != $_POST['password']) { ?> <form method="post" > Enter username: <input type="text" name="username" /><br/> Enter Password: <input type="password" name="password" /><br/> <center><input type="submit value="login" /></center> <?php } else { ?> <?php if ($_POST["email"]<>'') { $ToEmail = 'my email $EmailSubject = 'subject $mailheader = "From: ".$_POST["email"]."\r\n"; $mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; $mailheader …

Member Avatar
Member Avatar
+0 forum 4

i am very new to java i have found a piece off code [CODE] <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // The referrer info is only printed out when you // follow a link to the page with this script on it! if (document.referrer) { document.write("Thanks for visiting us from "); document.write(document.referrer); } // End --> </SCRIPT> [/CODE] And would like to know how to change it so it writes the message down on a txt file and saves that on my ftp, i do not want the message appering

Member Avatar
Member Avatar
+0 forum 1

Hello i have a basic website with a background and a container that contains the writing, The background covers the whole page as the contains runs down the middle with a gap of 300px each side, i am after making my container around 30% transparent, The container background is made up of 100px square repeated across the screen, if you need any more info just ask, thank you

Member Avatar
Member Avatar
+0 forum 11

Is it possible to create a piece of code that can learn? like a robot? e.g if it see's a picture of me, the code will learn and understand that the picture is me every time it see's it??

Member Avatar
Member Avatar
+0 forum 4

Hi all, I am after creating a small basic CMS sytem that will allow me to Change things after i have uploaded my site, How would i do this? I would like to change descriptions and add photos to the site?

Member Avatar
Member Avatar
+0 forum 5

Hi all im after a piece of code that allows the user to enter a fraction e.g 1/4 and have the code split that fraction into 2 seperate variables, e.g variable 1 containing the '1' variable 2 cantaining the '4' How would i achive this? My objective is to make a calculator for horse racing that will work out the payout for your horse, any ideas?

Member Avatar
Member Avatar
+0 forum 4

Hello all im trying to work out whats wrong with this code, [CODE]#include <iostream> using namespace std; int player1score = 0; // global variable int add10 (int &score) // function that adds 10 to player1score variable by reference { return(score + 10); } int main () { cout << "Please enter player score " << endl; cin >> player1score; add10 (player1score); // calls the function by reference cout << "the number you entered with the function added is " << player1score; }[/CODE] That code does not work but when passing arguments by value that code does work [CODE]#include <iostream> using …

Member Avatar
Member Avatar
+0 forum 2

I have been told that C++ and C# are very simular, as i am learning C++ and ust downloading XNA which use's C# I just wanted to know if C++ and C# are similar (exept the fact they both begin with the letter C )

Member Avatar
Member Avatar
+0 forum 3

i have been told to use a do while loop instead of a goto statment, here is a code i made to try the do while loop, [CODE] int main() { int A = 0; cout << "Enter a number from 1 - 5 " ; cin >> A; do { cout << "your number was 1"; cout << endl; }while (A == 1); do { cout << "your number was 2"; }while (A == 2); do { cout << "your number was 3"; }while (A == 3); do { cout << "your number was 4"; }while (A == 4); …

Member Avatar
Member Avatar
+0 forum 4

I am after making my program wait before responding to the users input, what code do i use for this and how do i implement it? [CODE]#include <iostream> using namespace std; int main() { char instuctions = 0; int A = 0; // user input 1 int B = 0; // user input 2 float total = 0; // total of input 1 and input 2 with addition float total2 = 0; // total of input 1 and input 2 with subtraction float total3 = 0; // total of input 1 and input 2 with division float total4 = 0; …

Member Avatar
Member Avatar
+0 forum 7

Hello i am watching some tutorials on [URL="http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=27"]3d Buzz[/URL] and intro to C++ starts by saying that [CODE] #include <iostream> main () { std::cout << "hello world!" << std::endl ; } [/CODE] should show a CMD like window saying Hello World! On the video they try it and it works i try it and get error message [QUOTE]c:\users\nat\documents\visual studio 2008\projects\Hello World\Hello world\hello.cpp(4) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int[/QUOTE] Why do i get this error message i have followed everything i have been told to,

Member Avatar
Member Avatar
+0 forum 3

The End.