PHP - Dynamic Links
This is a question about dynamic links. At the moment I have a dynamic page from a table, I'll call it tableA. The links all work fine, so when clicked, information is displayed from the table. The issue will be when I come to create a new table entry. This new pages (or entry), will itself contain a link to other information. Assuming I have the required information in tableA, how do I activate a dynamic link from within a page that itself dynamically produced? I use PDO for the link to the database, and the page that shows the text uses a form, with buttons to allow the user to select a menu item. The php: <?php // Connect to the databaase $PDO = new PDO("mysql:host=****;dbname=****", "****", "****"); // set the PDO error mode to exception $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Set up defaults $current_title = ""; $current_page_data = ""; // Check if the user posted the page if($_SERVER['REQUEST_METHOD'] == 'POST') { // Check if user pressed a menu button if(isset($_POST["menu"])) { // User has selected a menu, meaning a page was selected, now load the page $current_title = filter_input(INPUT_POST, "menu"); // Now get current data from the database, if the page was never created, add it to the database $stmt = $PDO->prepare("SELECT * FROM pages WHERE pageheader=?"); $stmt->execute([$current_title]); $row = $stmt->fetch(); if($row) { // Page is in the databaswe already, load the text for it if(isset($row["pagetext"]) AND trim($row["pagetext"])!="") { $current_page_data = $row["pagetext"]; } } else { // Page was never created, add it with blank text $current_page_data = "This page is under contruction!<br><br>Please check back again later!"; } } } ?> The form (partial): <form name="****form" method="post" action="#"> <table id="timeline"> <tr> <td id="contentMenu"> <span class="item"> <div class="dropdown"> <button class="dropdownButton">Pre 3150 BC</button> <div class="dropdownContent"> <button name="menu" type="submit" value="Predynastic Egypt">Predynastic Egypt</button> <button name="menu" name="menu" value="Lower Egypt">Lower Egypt</button> <button name="menu" type="submit" value="Upper Egypt">Upper Egypt</button> <button name="menu" type="submit" value="Upper and Lower Egypt">Upper & Lower Egypt</button> </div> </span> .... </td> </tr> </table> </form> <!-- page content --> <hr> <h1 class="center"><?php echo $current_title; ?></h1> <hr> <?php echo $current_page_data; ?>
Similar TutorialsHey, thank you for taking time to read this and for possibly helping me sort this. So I'm trying to make it so: Code: [Select] http://mysite.com/thing/key is rewritten as: http://mysite.com/thing.php?k=key while keeping a general rule for: http://mysite.com/thing being written to: http://mysite.com/thing.php Please help thank you. Can someone please help me? Scenario: Database table with varying amount of records, these will be displayed on a big screen with no user interaction, updating every set amount of time say 15 seconds. Once new data enters the database the page updates and shows that record. As there is only limited space on the screen i can only show e.g 1 record per page. I setup pagination which splits these records up into separate pages. so if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 1; $query = "SELECT * FROM table ORDER BY id ASC LIMIT $start_from, 1"; // run the query and store the results in the $result variable. $result = $mysqli->query($query) or die(mysqli_error($mysqli)); then output the links $total_pages = ceil($total / 1); for ($i=1; $i<=$total_pages; $i++) { echo "<a href=bigscreen.php?page=".$i.">".$i."</a> "; } This is all working fine and splits the pages and displays the links. Problem: I have been trying to get the page bigscreen.php to automatically loop through the pages that are created e.g 3 records = 3 pages so i want it to load bigscreen.php?page=1 then wait for 15 seconds then update to bigscreen.php?page=2 then 15 seconds then update to bigscreen.php?page=3 then back to bigscreen.php?page=1 and this will continue to do this for the amount of pages created. I have tried various methods but i am struggling. I keep getting a redirect loop error in chrome when i setup my loop. I was thinking of putting the links into an array? but i dont know that will work! Any help or tips would be greatly appreciated! Folks, I need help (Php code ) to generate a Dynamic Text on a Base Image. What i want to do is, to make this Image as header on my Site and to make this Header Specific to a Site, i want to Add the Domain Name on the Lower Left of the Image. Got the Idea? Here is the Image link: Quote http://img27.imageshack.us/i/shoppingheader1.jpg/ PHP Variable that holds the Domain name is: $domain All i need the Dynamic PHP Codes that i can put on all my sites to generate this Text on Image (Header) Dynamically... May Anyone Help me with this Please? Cheers Natasha T. <html> <?php $id = $_GET['id']; $dbusername="web148-matt"; $dbpassword="matt"; $dbdatabase="web148-matt"; mysql_connect(localhost,$dbusername,$dbpassword); @mysql_select_db($dbdatabase) or die( "Unable to select database"); mysql_query("UPDATE count SET clicks=clicks+1 WHERE id='$id'"); $sql = mysql_query("SELECT link FROM count WHERE id='$id'"); $fetch = mysql_fetch_row($sql); $result = mysql_query("SELECT * FROM count"); while($row = mysql_fetch_array($result)) { echo "<a href=" .$row['link']. ">Link</a>"; } ?> <a href='http://www.google.com'>Google</a> <a href='/index.php?id=2'>link2</a> </html> Hi all I need to combine these two scripts: Firstly, the following decides which out of the following list is selected based on its value in the mySQL table: <select name="pack_choice"> <option value="Meters / Pack"<?php echo (($result['pack_choice']=="Meters / Pack") ? ' selected="selected"':'') ?>>Meters / Pack (m2)</option> <option value="m3"<?php echo (($result['pack_choice']=="m3") ? ' selected="selected"':'') ?>>Meters / Pack (m3)</option> <option value="Quantity"<?php echo (($result['pack_choice']=="Quantity") ? ' selected="selected"':'') ?>>Quantity</option> </select> Although this works OK, I need it also to show dynamic values like this: select name="category"> <?php $listCategories=mysql_query("SELECT * FROM `product_categories` ORDER BY id ASC"); while($categoryReturned=mysql_fetch_array($listCategories)) { echo "<option value=\"".$categoryReturned['name']."\">".$categoryReturned['name']."</option>"; } ?> </select> I'm not sure if this is possible? Many thanks for your help. Pete So I have been working on my website for a while which all is php&mysql based, now working on the social networking part building in similar functions like Facebook has. I encountered a difficulty with getting information back from a link. I've checked several sources how it is possible, with title 'Facebook Like URL data Extract Using jQuery PHP and Ajax' was the most popular answer, I get the scripts but all of these scripts work with html links only. My site all with php extensions and copy&paste my site links into these demos do not return anything . I checked the code and all of them using file_get_contents(), parsing through the html file so if i pass 'filename.php' it returns nothing supposing that php has not processed yet and the function gets the content of the php script with no data of course. So my question is that how it is possible to extract data from a link with php extension (on Facebook it works) or how to get php file executed for file_get_contents() to get back the html?
here is the link with code&demo iamusing: http://www.sanwebe.c...-php-and-jquery
thanks in advance.
Hello! If you search Google, you'll notice the URL: http://www.google.com/webhp?hl=en#hl=en&source=hp&q=php+freaks&aq=f&aqi=g10&aql=&oq=&gs_rfai=CtdaTdtdRTNnPD5HuzASZtMWiCgAAAKoEBU_Q0ZT5&pbx=1&fp=19d754eee0b4f223 You can copy that URL anywhere you like... and the user will still see the same results. So basically the URL dynamically does an action, and accesses the database. How on do I make a URL like this? Meaning when you change the URL parameter values, it request a slightly different database query? Does that make sense? Similarly with NexTag.com: http://www.nextag.com/serv/main/buyer/ProductCompare.jsp?search=camera&page=0&node=500001&psort=%2FDigital-Cameras--zzcameraz500001zB6z5---html&zipcode=&cptitle=657166355&cptitle=656751324&cptitle=620051906&cptitle=705150048 That was a Dynamically made URL (I selected from check boxes which products to compare) and it makes that URL so anyone can see those products. Any ideas on how to do this? More examples on the URL: http://www.cars.com/go/compare/modelCompare.jsp?myids=9721,11439 (i select the cars, it generates that URL. Notice the IDs 9721,11439) trying to be able to store client information in mysql db for reference later in an admin area. The code I have so far allows me to list the client names, but once I "select" the name I want it to show the rest of the database information stored for that user (email, height, weight, phone number, etc...) which it currently is not doing. Any and all help will be greatly appreciated, tired of struggling through this blindly. Code: [Select] <? // Connect database mysql_connect("localhost","",""); mysql_select_db("mydb"); if(isset($select)&&$select!=""){ $select=$_GET['select']; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form id="form1" name="form1" method="get" action="<? echo $PHP_SELF; ?> "> Client Name : <select name="select"> <option value="">--- Select ---</option> <? // Get records from database (table "users"). $list=mysql_query("select * from users order by id asc"); while($row_list=mysql_fetch_assoc($list)){ ?> <option value="<? echo $row_list['id']; ?>" <? if($row_list['id']==$select){ echo "selected"; } ?>><? echo $row_list['name']; ?></option> <? } ?> </select> <input type="submit" name="Submit" value="Select" /> </form> <hr> <p> <? if(isset($select)&&$select!=""){ // Get records from database (table "users"). $result=mysql_query("select * from users where id='$select'"); $row=mysql_fetch_assoc($result); ?> Information about <strong><? echo $row['name']; ?></strong> client...</p> <p><? echo $row['email']; ?><br> ........................................<br> ........................................ <? // End if statement. } // Close database connection. mysql_close(); ?> </p> </body> </html> I want to get the ibase_blob_echo function and I was told I need to uncomment the extension=php_interbase.dll in my php.ini. So I did and now I get the message: Unable to Load Dynamic Library in a pop-up window. I'm lost and don't know how to solve this Holy smoke, it has been a looooooong time since I have been here. Love the new look of the site btw. Well I am working on a new project for my church. The idea is an email to SMS program. So one use of this would be that if there is a youth activity I could send a message to the entire youth group with one message. I am trying to figure out something specific with it. I need to create a form that grabs info from the database. So more specifically what I need is one drop down that will have "Youth Group", "Parents", "Deacons", etc. now based on what I select I need the second drop down to populate with the corresponding people in that group. Now I want an "All" to be in the drop down to which would let me send the message I type to ALL people in the desired group but to also have the individual names come up just in case I need to do a specific person. How would I go about doing something like this? I have done much research and cant quite find what I would need to do. Any help would be GREATLY appreciated. Hi, I'm learning php and I'm trying to get to grips with dynamic xml and php coming from a database. The trouble I am having is I can't get my code to give any output. I don't get an error I message, I just can't get the xml to display. If anyone can give me any pointers as to what I'm doing wrong that would be great... Here's the code I have. Code: [Select] <?php DEFINE ('DB_USER', 'root'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'flashphpbible'); $link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query = "SELECT * FROM dynamicxml WHERE id=1"; $result = mysqli_query($link, $query); $xmlData .= " "; $xmlData .= "<store>\n"; while($row = mysqli_fetch_array($result)); { $xmlData .= " <item>\n"; $xmlData .= " <name>".$row['name']."</name>\n"; $xmlData .= " <section>".$row['section']."</section>\n"; $xmlData .= " <price>".$row['price']."</price>\n"; $xmlData .= " <inStock>".$row['instock']."</inStock>\n"; $xmlData .= " </item>\n"; } $xmlData .= "</store>\n"; echo "response=".$xmlData; ?> Thanks for any help offered. Ben. I know this topic is everywhere but I cant find a solution to my particular problem. I have been using a download center script for about a year. http://download.redgalaxy.net/ However, the title is static, keeping with the predefined one. I am trying to get the title to change so it matches the file name shown on the display page "index.php/?nav=display&file=25". I have spent days trying to figure something out with absolutely no luck. Does anyone have an idea how to get the title to change when dynamically? Out of desperation i used an onload javascript but it doesnt work with crawlers. Thank you in advanced. Index.php <?php /* PHP Download Center Copyright (C) 2007 Chris LaPointe This program is free softwa you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ //error_reporting(E_ERROR); define("PHP_DOWNLOADCENTER", 1); include_once('settings.php'); //Include all files in 'inc' directory $path = 'inc/'; $handle = opendir($path); while (false !== ($file = readdir($handle))) { if (substr($file, 0, 1) != '.') include($path.$file); } closedir($handle); //Start session for me! session_start(); if (mysql_connect($mysql_host, $mysql_username, $mysql_password) == FALSE){ if (file_exists("install.php")){ echo '<HTML><HEAD><meta http-equiv="refresh" content="0;url=install.php"></HEAD></HTML>'; exit; }else{ die("Fatal error. Unable to access database. In addition, unable to go to install.php to setup access!"); } } if (mysql_select_db($mysql_database) == FALSE){ if (file_exists("install.php")){ echo '<HTML><HEAD><meta http-equiv="refresh" content="0;url=install.php"></HEAD></HTML>'; exit; }else{ die("Fatal error. Unable to access database. In addition, unable to go to install.php to setup access!"); } } //because of the way it is handled, there should never be any HTML passed via arguments //do a check here foreach ($_GET as $key => $value){ $_GET[$key] = strip_tags(html_entity_decode($value, ENT_NOQUOTES), '<i><b>'); } //Run the now (Just code, ie login code) if ( isset($_GET['now']) ){ $nowfile = "pages/".$_GET['now'].'.now.php'; if (file_exists($nowfile)){ include($nowfile); }else{ echo "<b>Warning:</b> Now file '$nowfile' doesn't exist"; } } ?> <HTML> <HEAD> <TITLE><?php echo $page_title; ?></TITLE> <link rel="stylesheet" type="text/css" href="style.css"> </HEAD> <BODY> <!--TOP SECTION (banner)--> <table width=100% border=0 cellspacing=2 cellpadding=0> <TR> <TD valign="top"><img src="theme/page/banner.gif"></TD> <TD valign="middle"><div align="right"><?php include('ads/ad_top.php'); ?></div></TD> </TR> </TABLE> <!--MIDDLE SECTION--> <table width=100% border=0 cellspacing=2 cellpadding=0> <TR> <TD width=150px valign="top"><?php require('left.php'); ?></TD> <TD valign="top"> <table width=100% border=0 cellspacing=2 cellpadding=0> <TR><TD><?php include('nav.php'); ?></TD></TR> <TR><TD><?php include('body.php'); ?></TD></TR> </table> </TD> </TR> </table> <BR> <div align="center"><font size="1"> This page is under the <a href="http://gplv3.fsf.org/">GPLv3</a> by <a href="http://www.redgalaxy.net" target="_blank">Red Galaxy</a>. Each file is copyrighted by its respective owner.<BR> This page is not to be held responsible for any uploaded files. It is each user's responsibility to check the legality of files they upload.<BR> Please contact <i><?php echo $info_name; ?></i> at <?php echo str_replace('@', "'AT'", str_replace('.', "'DOT'", $info_email)); ?> with any questions.<BR> <?php echo $info_misc; ?></font> </div> </BODY> </HTML> <?php mysql_close(); ?> nav.php <?php if (!defined('PHP_DOWNLOADCENTER')) exit; ?> <table width=100% border=0 cellspacing=0 cellpadding=0> <TR> <TD> <a href="?nav=home">Home</a> | <a href="?nav=recent">Recent Files</a> </TD> <TD align="right"> <form action="?nav=search_results" method="post"><INPUT type="text" size="20" name="search"><INPUT type="submit" value="Search"></form> </TD> </table> body.php <?php if (!defined('PHP_DOWNLOADCENTER')) exit; if (!isset($_GET['nav'])){ $location = 'pages/home.php'; }else{ $location = 'pages/'.$_GET['nav'].'.php'; } if (isset($_GET['message'])){ echo '<div align="center">'; echo BeginBorder("Message", "50%"); echo stripslashes(urldecode($_GET['message'])); echo EndBorder(); echo '</div>'; } if (file_exists($location)) include($location); else include("pages/404.php"); ?> display.php <?php $fid = $_GET['file']; $results = mysql_query("SELECT * FROM files WHERE id=$fid LIMIT 1"); if (mysql_numrows($results) == 0){ echo "File not found. It may have been removed."; return; } $who = getUserNameById(mysql_result($results,0,"uid")); echo BeginBorder(mysql_result($results, 0, "title"), "90%"); ?> <TABLE width=100% border=0 cellspacing=0 cellpadding=0> <TR><TD width=50% valign="top"> <TABLE width=100% border=0 cellspacing=1 cellpadding=2> <TR bgcolor=#F0F0F0> <TD width=50%>Name:</TD> <TD><?php echo mysql_result($results, 0, "title"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>File:</TD> <TD><?php echo mysql_result($results, 0, "filename"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Size:</TD> <TD><?php echo round( mysql_result($results, 0, "filesize")/1024/1024,2).'MB'; ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Extension:</TD> <TD><?php echo mysql_result($results, 0, "filetype"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Category:</TD> <TD><?php echo mysql_result($results, 0, "category"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>User:</TD> <TD><?php echo $who; ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Date Uploaded:</TD> <TD><?php echo mysql_result($results, 0, "date"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Download Count:</TD> <TD><?php echo mysql_result($results, 0, "dcount"); ?></TD> </TR> <TR bgcolor=#F0F0F0> <TD>Downloads This Month</TD> <TD><?php echo mysql_result($results, 0, "dmonth"); ?></TD> </TR> </TABLE> </TD> <TD valign="top"> <center> <a href="<?php echo '?nav=download&file='.$fid; ?>"><img src="theme/download.png" border=0></a> <?php if (mysql_result($results, 0, 'private') == '1') echo "<br>You must be logged in to download this file.</b>"; ?> </center><BR><BR> <?php //PREVIEW IMAGE IF EXISTS $realname = mysql_result($results, 0, "filename"); $small_preview = 'images/'.$realname.'.small.jpg'; $large_preview = 'images/'.$realname.'.large.jpg'; if (file_exists($small_preview)){ echo "<div align='center'><a href='$large_preview' target='_blank'><img src='$small_preview' border='0'></a></div><BR>"; } //ADMIN CONTROLS if (isUserAdmin()){ echo '<b>Admin:</b> <a href="?nav=delete&file='.$fid.'">Delete This File</a> | <a href="?nav=edit&file='.$fid.'">Edit</a><BR>'; } ?> </TD></TR> </TABLE> <HR> <b>Description:</b><BR> <?php echo mysql_result($results, 0, "description"); ?> <?php echo EndBorder(); ?> I've been working on this for the last few hours and haven't had much luck. Basically, every time you visit the index of my site a random image is shown. The images are stored in a directory, and i use a table to hold the id, name, and url of each image. When the index page is loaded a random int is chosen, and the id equal to the int prints the corresponding url for the image. Now i'm trying to add the id into the url, "domain.com?img=1". I also need this url to always refer to the image in row 1. My table is called uploaded_images and the columns are id(primary key), name, url. I'm pretty lost, any help is greatly appreciated. Im working on a site and particularly the photo gallery section. I want to display 9 images on 3 rows (3 per row). And im stuck. Te only way i can get the images to show up not one on top of the other is by using a table. but how can i tell the table to only put 3 <td>'s then to <br> Heres my code so far... <?php $sql_images = mysql_query("SELECT * FROM photos ORDER BY upload_date DESC LIMIT 9"); while($row = mysql_fetch_array($sql_images)){ $photo_id = $row["id"]; $location = $row["location"]; $display_pics .= ' <td width="125px"> <a href="image.php?id='. $album_id .'" class="black"><img src="images/uploads/thumbs/' . $location . '" /></a> </td>'; } ?> Then to display it ... Code: [Select] <table width="top" cellpadding="10" cellspacing="20"> <tr> <?php echo $display_pics; ?> </tr> </table> My goal is to do it as simple as possible! Can anyone help? If you don't think tables are the way to go im open to any suggestions. I've thought about <divs> but then the images show up one on top of the other and not beside each other. By the way all the images are a max of 100px heigh and 100px wide Thanks for any help or suggestions! Hi, I am using php dynamic listing from database. it is working but I wanna integrate to a horizontal css menu how can i integrate my codes to any css horizantal dropdown menu. thans. here my dynamic list. <?php function sinirsiz_kategori($parent) { $sql = mysql_query("SELECT * FROM kategoriler ORDER BY id DESC"); while($row = mysql_fetch_array($sql)) { $diziler[$row['id']] = array('baslik' => $row['baslik'],'parent' => $row['parent']); } $has_childs = false; foreach($diziler as $key => $value) { if ($value['parent'] == $parent) { if ($has_childs === false){ $has_childs = true; echo "\t<ul>"; } echo "<li><a href=\"".$value['baslik'].".php\">".$value['baslik']."</a>"; sinirsiz_kategori($key); echo "</li>\n"; } } if ($has_childs === true) echo "</ul>"; } ?> <?=sinirsiz_kategori(0)?> hi all, im looking at a countdown timer and when a user places a bid it resets the timer, exactly like the one used at madbid.com, is this a mixture of javascript and php or just php? if you could point me in the right direction of what to look into that would be very helpful Lee Hi all This probarly looks really bad but im trying to replase tags that change. So far it only replaces the last tag and not well either. I will try to show you Code: [Select] function testfunc($value) { if ($value=='gallery'){$return .= "this gallery has worked = --$value--";} if ($value=='email'){$return .= "this email has worked = --$value--";} return $return; } $test = "this is a test {%email%} message {%gallery%} rtfgdsfgdsfg"; $test = preg_replace("#(.*){%(.*?)%}(.*)#is",'$1' . testfunc('$2') . '$3', $test); echo $test; this outputs this is a test {%email%} message rtfgdsfgdsfg but im trying to get this this is a test this email has worked = --email-- message this gallery has worked = --gallery-- rtfgdsfgdsfg Im sure im way off but I hope you can understand. Thank you for taking the time to read this post. Hello: I am trying to make a StyleSheet updateable from my admin panel, but I'm not sure if what I want to do is possible. So ... I have a TEXTAREA in my admin panel that writes to the DB just fine. it has styles like: Code: [Select] body { margin: 5px 0; padding: 0; background-color: #ebe9e6; background-image: url('../images/Site-BG2.jpg'); background-position: center bottom; background-repeat: no-repeat; background-attachment: scroll; font-family: arial, sans-serif; font-size: 100%; line-height: 1.4em; } ... Etc... On the frontend, it writes into the StyleSheet just fine like: Code: [Select] <?php include('myConn.php'); //contains your mysql connection and table selection $query=mysql_query("SELECT * FROM myStyleSheet") or die("Could not get data from db: ".mysql_error()); while($result=mysql_fetch_array($query)) { $myPageData=$result['myPageData']; } ?> <?php echo $myPageData; ?> So, what I want to see is if I can somehow pull the styles onto the page like: Code: [Select] <link rel="stylesheet" type="text/css" href="include/StyleSheet.css" /> Now, if I do it as listed above it and look at the code it displays the Code: [Select] <?php include('myConn.php'); //contains your mysql connection and table selection Etc... If I do it like Code: [Select] <link rel="stylesheet" type="text/css" href="include/StyleSheet.php" /> It displays the styles fine, but the browser doesn't read it as a StyleSheet and therefore the page doesn't get formatted. So, is there any way to make this work? Anyone have any ideas about this? The idea is so I can manage the Styles via an admin panel remotely without having to login with web editing software. Thanks. Hey guys does anyone know of a good dynamic directory solution? What i mean by this is when i am creating an application and i use require_once 'includes/config.php'; and then i create a class that needs the config file so i include it into the class like so: require_once '../include/config.php'; then i make a new folder named member then i have to require this class (created above) and it fails to find the directory. What would be a good solution for this? Thanks guys!! Hey All, Im having trouble tring to figure out how to save dynamic radio buttons. I have a project where i have to use radiobuttons instead of checkboxes. Basically, there is a database table with "roles" in it ... i.e administrator, user, etc etc etc and these are updateable but the user. On a specific page, these get spit out with a radio button next to them, like so: <input name="wfa" type="radio" id="wfa" class="radio" value="1" /><label for="wfa">administrator</label> These go on down the page, for as many entries there are in the database. What i need to do is save the checked ones to the database, but being dynamic i cant save each value to a individual row ..... any help? Someone mentioned serialize, i had a look at the php documentation but it didnt make much sense to me. Cheers. |