PHP - Complexed... Clicked Link -> Add Row Action
Hi I was thinkin that I wanna make a simulor function to the one they use on betting site...
User sees Team1 vs Team2 When he clicks "team2" it gets registered somewhere before he clicks "bet" wich inserts all his bets somewhere. Similar TutorialsI know that PHP is server-side, but I wondered whether anyone had a similar issue that they got around... here's my problem... I've made a psycho-analysis tool for Facebook where it runs your Facebook friends through a database of words to get their psychological preferences (that all works)... I then have a link so that users can tell their friends about the service (it's free, so I want to get it to spread virally) but I'm having a few issues with the link... At the moment, it all works from a Facebook point of view, but when they click on the link, it takes them to an almost-blank page with a bit of code on it. I know what this code is and why it's there, but I'd like to hide it behind a branded page, ideally with Ajax. When I tried to use Ajax for it, it wouldn't accept the URL that was sent. The link has to have a URL sent to Facebook like this: Code: [Select] https://graph.facebook.com/feed?access_token=149324721793321|HarGd6ioqoroENE9gv2758rfeYY&message=I%27ve+just+psycho-analysed+my+Facebook+friends+using+Manteya%27s+Facebook+Friend+Checker+%28http%3A%2F%2Fwww.manteya.com%2Ffacebook-friend-checker%29+so+that+I+can+communicate+better+with+you.&id=100001925276042 but for obvious reasons, you can't post it as an Ajax variable by using the: Code: [Select] http://www.url.com/test.php?id=$variable; Is there a way I can get around the problem? I guess the issue is that Facebook needs the detail in the URL, but PHP won't let me send it like this. I have thought about uploading the URL to a database and shortening the URL, then posting that, which would then re-direct, but that's a messy way around I'm sure you smart people have done something like this before. To see my existing (almost) working example, visit http://www.manteya.com/ffc Thanks, Neil I have a "Members" page that displays my organizations members info via My SQL. Currently, the database displays "State" quick links at the top and has the members organized by State down the page. If you click on one of the State links at the top, it will navigate to the section of the page with that state and associated members. I want the members associated with a specific state to be displayed only once I click the associated state link -- instead of all of the information showing at once like it is now. The page I am referring to can be seen at this link: http://homesforhorse...rs.com/members/
<?php update_option('image_default_link_type','none'); include("/home/cingen/config_admin.php"); function listMembers() { $sql = mysql_query("SELECT c.*, s.* FROM (".TABLE_MEMBERS." c LEFT JOIN ".TABLE_STATE." s on c.state = s.state_abbr) WHERE c. status = '1' ORDER BY c.country, c.state, c.organization ASC"); while ($row = mysql_fetch_array($sql)) { $display_members = false; $organization = stripslashes($row['organization']); $website = stripslashes($row['website']); if ($website) { $link = "<a href='http://".$website."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } $display_members .= $link.$organization.$endlink."<br />"; if ($row['address']) $display_members .= stripslashes($row['address'])." ".stripslashes($row['address2'])."<br />"; if ($row['city']) $display_members .= stripslashes($row['city']).", "; if ($row['state']) $display_members .= stripslashes($row['state']).""; if ($row['zip']) $display_members .= " ".$row['zip']; $display_members .= "<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a><br/>"; if ($row['year_est']) $display_members .= "Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= " A 501(c)3 non-profit."; if ($row['gfas'] == "1") $display_members .= "<br />GFAS: Accredited Sanctuary."; if ($row['gfas'] == "2") $display_members .= "<br />GFAS: Verified Sanctuary."; if ($row['member_category']) $display_members .= "<br />".$row['member_category']; $display_members .= "<br /><br />"; $entries[$row['country']][$row['state_name']][] = $display_members; } $countrylinks = false; $statelinks = false; $display = false; if(is_array($entries)){ $display .= ' <div class="memberlist">'; foreach($entries as $country=>$state_members){ $countrylinks .= '<a href="#'.$country.'">'.$country.'</a> '; $display .= ' <h2 id="'.$country.'">'.strtoupper($country).'</h2> <div class="country">'; if(($state_members)){ foreach($state_members as $state=>$members){ $statelinks .= '<a href="#'.$state.'">'.$state.'</a> '; $display .= ' <h3 id="'.$state.'">'.strtoupper($state).'</h3> <div class="state">'; if(is_array($members)){ foreach($members as $key=>$member){ $display .= ' <div class="member"> '.$member.' </div>'; } } $display .= ' </div>'; } } $display .= ' </div>'; } $display .= ' </div>'; } $statelinks1 = ' <h2>Members List</h2> <strong>Quick Links</strong><br /><br /> '.$statelinks.'<br /><br />' .$display; return $statelinks1; } add_shortcode('memberlist', 'listMembers'); function listRescueStandards() { $display_members = ''; $sql = mysql_query("SELECT vc.*, s.*, m.* FROM ".TABLE_COMPLIANCE." vc, ".TABLE_STATE." s, ".TABLE_MEMBERS." m WHERE vc.member_id = m.cid AND m.status = '1' AND m.state = s.state_abbr ORDER BY m.state, m.organization ASC"); while ($row = mysql_fetch_array($sql)) { $organization = stripslashes($row['organization']); if ($row['website']) { $link = "<a href='http://".$row['website']."' target='_blank'>"; $endlink = "</a>"; } else { $link = ""; $endlink = ""; } if($x!=$row['state_name']){ $display_members .= "<br /><strong>".strtoupper($row['state_name'])."</strong><br />"; $x = $row['state_name']; } $display_members .= $link.$organization.$endlink."<br /> ".stripslashes($row['address'])." ".stripslashes($row['address2'])."<br /> ".stripslashes($row['city']).", ".stripslashes($row['state'])." ".$row['zip']."<br />"; if ($row['contact_name']) $display_members .= "Contact: ".stripslashes($row['contact_name']); if ($row['contact_title']) $display_members .= ", ".stripslashes($row['contact_title']); if ($row['phone']) $display_members .= "<br />Tel: ".stripslashes($row['phone']); if ($row['fax']) $display_members .= "<br />Fax: ".stripslashes($row['fax']); if ($row['email']) $display_members .= "<br />".$row['email']; if ($row['website']) $display_members .= "<br /><a href='http://".$row['website']."' target='_blank'>".$row['website']."</a>"; if ($row['year_est']) $display_members .= "<br />Founded in ".$row['year_est']."."; if ($row['org501c3'] == "1") $display_members .= "<br />This organization IS registered with the IRS as a 501(c)3."; if ($row['org501c3'] != "1") $display_members .= "<br />This organization is NOT registered with the IRS as a 501(c)3."; $display_members .= "<br /><br />"; } return "<div class='memberlist'>" . $display_members . "</div>"; } add_shortcode('standardslist', 'listRescueStandards'); I have a page that reads from a database to list employees from different states. Under each name is a link that pulls up a new window with a contact form. My goal is to get the name from that link to appear on that new window. (Which I will then use to ultimately add the name into the email that was generated so the recipient can know who the email was intended for.) I've tried using the GET and POST methods but nothing seems to work. Any help would be appreciated greatly. I will name my firstborn after anything you desire. I've included my code below. (The last line is what I've been primarily working with) Code: [Select] //Open Database Connection $db = open_db_connection(); $sql = "SELECT DISTINCT 1 from users where active = 'Y' and show_on_contactus = 'Y'"; $results = mysql_query($sql, $db); $emaillink = "<a target='main' onclick=window.open('contactform/contactCentral.php?name=$state_row[state]','popup','width=380,height=400,scrollbars=no,resizable=no,toolbar=yes,directories=no,location=no,menubar=yes,status=no,left=0,top=0'); return false>"; if(!mysql_num_rows($results) == FALSE) while($row = mysql_fetch_array($results, MYSQL_BOTH)) { echo "<ul id=\"directors\">\n"; $state_sql = "SELECT * from users where active = 'Y' and show_on_contactus = 'Y' and state_full = 'indiana' order by last_name"; $state_results = mysql_query($state_sql, $db); if(!mysql_num_rows($results) == FALSE) { while($state_row = mysql_fetch_array($state_results, MYSQL_BOTH)) { echo "<li>\n"; echo " <div class=\"fl dirimg\">\n"; if($state_row[photo] == "") { echo "<img border=\"0\" width=\"61\" height=\"85\" src=\"images/exe_placeholder.jpg\" alt=\"$state_row[first_name] $state_row[last_name]\" />\n"; } else { echo "<img border=\"0\" width=\"61\" height=\"85\" src=\"n2team/pictures/$state_row[photo]\" alt=\"$state_row[firstname] $state_row[last_name]\" />\n"; } echo " </div>\n"; echo " <span class=\"fr\">$state_row[first_name] $state_row[last_name]<br />\n"; echo " $state_row[title]<br />\n"; echo " $state_row[city], $state_row[state]<br />\n"; echo " $emaillink Contact $state_row[first_name] </a></span></li>\n"; } Hello, I had a web page which had sharing (share issue on facebook, twitter....) and I want to record what each user had shared. So, they will click on alink to share it. I want to call a php function when the user click on a link, whats the best method to do this? Thanks in advance I know with a submit button I can have a new record created when clicking it, but is it possible to do with a text link? Hi there, I've been tasked with the job of re-doing the company website from scratch and I'm having a bit of trouble with some of the logic involved as I'm not a web designer by trade. Or by any reasonable stretch of the imagination. Anywhoot, what I'm struggling with is this: I have laid out the website so for each of the core business units there is one php page, call it 'page x'. On page x there are two sections; a sidebar and a content section. At the top of page x there is a menu bar with a links to a different category (eg. services, products, about, contacts, etc). What I have at the moment for page x is an INCLUDE statement in each of the subsection which pulls through a html page and plops it down in the right place. What I am struggling with is how to use the links at the top of the page to pull through a different html page depending on what link I click. I was thinking that I could use something a couple of variables, $sidebar and $content, and then some kind of on-click function to pass a string to each of the variables and then use the INCLUDE statement to call the correct pages. What I have tentatively come up with is this : Code: [Select] <a href=#><img src="/MS_Images/service_hlight.jpg" width="100" height="42" onclick=$sidebar = "OutsourceIT_Website/Managed Services/services_side.html" /></a> and then: Code: [Select] <?php include $sidebar; ?> Would this work in principle? How do I go about making sure that the variable in the link is declared properly? Is there a better way to go about doing this that I am missing due to my ignorance? Hope someone can help because Uncle Google is getting fed up with my vague search terms. Hi, I'm not super fluent in PHP or whatnot, but I currently have a website set up with an index.php to load the content pages within it. As part of the template, it consists of a header image, links, a photo, and a video. The content of each page loads within the specified area below the "template". Here's my question: My client wants to see a specific picture when they click one of hte links. For example, if they clicked on spot removal, the image beside the navigation should show spot removal and stay there on the index page while the content page, spot removal is shown. Does this make sense? I need help and fast. Screenshot included in attachment. And like I said, I'm not super fluent in PHP/MYSQL, so be very detailed when talking about what to do. I'd appreciate the help. Thanks, I feel like a moron asking this question as it seems to be one of the most common things done with php but I cannot find a tutorial (probably because I don't know the correct wording to search under) on this specific thing.. Anyhow. I'm spitting out a list of the Titles of my test table like so (and its working as expected): <?php $posting_sql = "SELECT * FROM postings"; $posting_results = (mysqli_query($cxn, $posting_sql)) or die("Was not able to grab the Postings!"); while($posting_row = mysqli_fetch_array($posting_results)) { echo "<li><a href='posting_details.php'>$posting_row[title]</a></li>"; } ?> Now as you can see: <a href='posting_details.php'> I am calling a new page, and that page contains this: <h2><?php echo "$posting_row[title]"; ?></h2> <p><?php echo "$posting_row[description]"; ?></p> It's no surprise it's not working (with many variations etc), but I am only familiar with using <form> GET or POST, and these of course are not form elements, so I cant seem to call them the same way. My suspicion (and from the research data I could find) is that I need to pass values in my link: <a href='posting_details.php'> ... I could not get it to work, but I was trying variations like: <a href='posting_details.php?get[title&get[description]]'> but it seems like I am screwing things up even more by doing this.. Anyhow. If anyone could show me a tutorial that covers this specifically or some suggestions on the best approach to this would be much appreciated.. Hi, Is it possible to build a PHP Template page that selects and publishes a row of data from a MySQL Database when a linked is clicked? I would design: Template.php Text links (perhaps on homepage of navigation bar): ProductA, ProductB and ProductC If you click link ProductA Template.php would display data for ProductA and likewise for ProductB and ProductC. I would also like search engines for find ProductA, ProductB and ProductC PHP pages. (Not just my single Template.php) Any ideas as to how this could be done without designing individual PHP pages for each product? Kind regards, Matthew. Hi I am building a class to manage site users (Via a CMS). In order to complete this I am building a delete/remove user function/method. Things are going ok (I think), but I am confused about what to put in the action tag of the form being used to process the data. Before coding my method, I referred to a script that someone showed me which does something similar in functionality: it deletes photos previously uploaded to a folder, and also removes the associated information from the database. I used this script as the framework for the code that I am working with. Eveything seems to be working fine - EXCEPT - when I click on the 'delete users' button, nothing happens. The first thing that I examined for error was the action attribute within my form. The value of the action attribute is: action = "<? php htmlentities($_SERVER["PHP_SELF"]) ?>" This format has worked for previous forms. I compared this to the action attribute within the script that I was using as a guide. It's value is set as follows: action = "remove_photo.php?<?php echo "action='godel' ";?> In this instance, remove_photo.php is the file that is being used to both process and display the form. The reference script works perfectly but it uses a procedural approach . For my application, I am using a more object oriented approach, so both my opening and closing form tag elements are stored in a seperate file to the class file that processes it. I am new to OO but relatively comfortable with the paradigm so far (my other methods etc are working fine). I therefore suspect that the reason for my script's inability to process is due to the action attribute setting (I cannot be 100% sure of course!). I am going to therefore apply the action attribute settings used successfully in the reference script, to the application that I am building. However, the trouble is, I don't understand it I don't like it when something works, but I can't see the logic behind why it does. I am not concerned about the form id or method attrbutes. I understand what is going on there - and why they are set as they are. However, the action attribute is very difficult to understand for the following reasons: 1/ There is no variable/method/entity/object/ANYTHING called 'godel' elsewhere in the reference script. For this reason I thought that it might not be needed, so removed the bit of code within PHP tags concerning it: <?php echo "action='godel' ";?> - When I did this - the script didn't work. In fact - nothing at all would process. This was a similar result to what was happening with the script I am building. 2/ I then put the PHP line back in, but replaced 'godel' with 'something'. I saved and processed the form. - it worked. 3/ I then tried it again replacing 'godel' with an empty string i.e: ' '. - it worked. Has anyone come across forms being processed in a similar way before? If so, please could you explain what is happening here. I can't find anything relating to this type of occurence online.... I am going to place the php tags in the file I am building, to see if it has the desired effect. If it does, I will obviously keep it. But not understanding what is happening, or why it is happening is very annoying!! Thanks When I click the save changes button, I want the user to be brought back to profile.php. Right now they are being brought to editprofile.php. I currently have the form action set to editprofile.php . When the I change it to profile.php my fields won't update. Any thoughts as to where I went wrong? Here is the editprofile.php code. <form action='editprofile.php' method="POST" id="form"> I have an action that will take a long time to finish, so how can I run this action in background? So I will not have to wait it ends... echo(" <form method = \"get\" action = \"DeleteApp.php?pname=\" . $Applications['Name'] . \"> <input value='Delete' type='submit' /> </form> "); Why is this redirecting to: DeleteApp.php?. Instead of what you can obviously see what it's supposed to redirect to. Hello everyone from a php newbie, I have a option selections box and need to select an action depending on the results. Its for an insert script for items into a Database and depending on the chosen option it add the picture to the DB table The selection options are <select name="extension" style="font-size:18px"><option value="pdf">PDF</option><option value="zip">ZIP</option><option value="powerpoint">PowerPoint</option></select> the Swtich is switch $_POST['extention']{ case 'zip': echo $insert_image = $_POST['extension'].'winzip.gif'; break; case 'powerpoint': echo $insert_image = $_POST['extension'].'ppt.gif'; break; default: echo $insert_image = $_POST['extension'].'products/pdf.gif'; } Would someone please tell me if this is correct syntax? Or have i got it horribly wrong! Thank you for your a help Charlie Hi everyone I am trying to pass a php variable ($R1 = 1) in to action script flash 8. After this variable is in flash 8 I want the action script to do a if statement that says if the php variable is = 1 then display layer or object. However i am not sure how to do this any help would be great thanks Freid001 PS if this is not possible to do with php and action script please say thanks im making this tool to clean up some data from a sql database, i made a php code to list what i need, thats player name,lvl and id from table_A, the problem is i want to delete from table_A and from table_B all the results from php code , they have in common the id and as a condition the lvl must be lower then 10, it seems i cant make it delete from table_B also,please help me!! a button of the end of the page to delete all that includes same id from both tables is what im looking for! Code: [Select] <table<?php echo $tableSet; ?>> <tr> <td width="*" align="center">Rank</td> <td width="*" align="center"><font color="#000000">Name</td> <td width="*" align="center"><font color="#000000">money</td> <td width="*" align="center"><font color="#000000">id</td> <td width="*" align="center"><font color="#000000">lvl</td> </tr> <?php $rank = mysql_query('SELECT name,money,id,level FROM table_A WHERE level < 10 ' .' ORDER by level desc LIMIT '.$limit.';'); $i=1; while ($row = mysql_fetch_array($rank)) { echo '<tr><td align="center">'.$i.'.</td> <td align="center"><font color="#0000FF">'.$row['name'].'</td> <td align="center"><font color="#0000FF">'.$row['money'].'</td> <td align="center"><font color="#0000FF">'.$row['id'].'</td> <td align="center"><font color="#FF0000">'.$row['level'].'</td> </tr> '; $i++; } ?>this is showing which player names goes to id(from table_A) i need to delete from table_a where the ids shown are lower then lvl 10(the ones result from code above) and same ids from table_b (the rank is just to show me ho is highest lvl) Hi all, I wonder if anyone could give me some idea: I have a form and one of the filed is an email (must field) if empty an error message will show up: - Now I want to add a CHECKBOX where when the CHECKBPX is clicked the "must field" email will become" not must field one" (Not required field). I have this code as my snippets: Code: [Select] <form action="<?php echo $PHP_SELF;?>" method="post" name="reg1"> .. <tr> <td><input name="noemail" type="checkbox" value="noemail"> Do not want to get the E-mail address</td> </tr> <tr> <td nowrap>Enter email <input name="email1" type="text" <?php if ($_POST['action'] == "register") { echo 'value="'.$_POST['email1'].'"'; } ?>> </td> </tr> .. </form> .. .. $error = 0; $errormsg = ""; .. .. if ($_POST['action'] == "register") { if (($_POST['email1'] == "") OR (!check_text($_POST['email1']))) { $error = 1; $errormsg .= "Please enter your requested email address<br>"; $errornum[3] = 1; } } .. Can anyone assist me what shall I add so I can achieve this please? Thanks in advance. Siabanie Im having some problems with my PHP program... Im trying to get the imformation send to my inbox, but when i push the submit button; i get no email and the "thank you message" is incomplete.. (see attachement: thankUmessage.png) I have to say, im not really a PHPfreak , I understand this language a little.. I hope someone can help me first the codes: HTML: (see attachement: form.png) Code: [Select] <!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>contactformulier</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: #FFFF00; } body { background-color: #CCCCCC; } .style2 {font-size: 16px} --> </style> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } //--> </script> </head> <body> <form id="form1" name="form1" method="post" action="contactafhandeling.php"> <table width="400" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#000000"> <!--DWLayoutTable--> <tr> <td height="39" colspan="6"><div align="center" class="style2">Contact formulier<br /> </div></td> </tr> <tr> <td height="21"><div align="right">Aanhef:</div></td> <td width="4" rowspan="7"> </td> <td colspan="4" valign="top"> <select name="aanhef" id="aanhef"> <option value="dhr" selected="selected">Dhr.</option> <option value="mvr">Mvr.</option> </select> </td> </tr> <tr> <td width="72" height="20"><div align="right">Voorletters:</div></td> <td width="42" valign="top"><div align="left"> <input name="voorletters" type="text" id="voorletters" size="5" maxlength="40" /> </div></td> <td width="120" valign="top"><div align="center">Achternaam: </div></td> <td colspan="2" valign="top"><div align="left"> <input name="achternaam" type="text" id="achternaam" size="20" maxlength="40" /> </div> <div align="left"></div> </td> </tr> <tr> <td height="20"><div align="right">Adres:</div></td> <td colspan="2" valign="top"><div align="left"> <input name="adres" type="text" id="adres" size="20" maxlength="40" /> </div> <div align="center"></div> <div align="left"></div></td> <td width="79" valign="top"><div align="center">Postcode:</div></td> <td valign="top"><div align="right"> <input name="postcode" type="text" id="postcode" size="10" maxlength="7" /> </div></td> </tr> <tr> <td height="20"><div align="right">Woonplaats:</div></td> <td colspan="4" align="right" valign="top"><div align="left"> <input name="woonplaats" type="text" id="woonplaats" size="20" maxlength="40" /> </div> <div align="left"></div> <div align="left"></div> <div align="left"></div></td> </tr> <tr> <td height="20"><div align="right">Tel:</div></td> <td colspan="4" valign="top"><div align="left"> <input name="tel" type="text" id="tel" size="20" maxlength="10" /> </div></td> </tr> <tr> <td height="20"><div align="right">Email:</div></td> <td colspan="4" valign="top"> <div align="left"> <input name="email" type="text" id="email" size="40" maxlength="40" /> </div></td> </tr> <tr> <td height="20"><div align="right">Interesses:</div></td> <td colspan="4" valign="top"><div align="left"> <label></label> <label> <input type="checkbox" name="badkamer" id="badkamer" /> Badkamermeubels</label> <label> <br /> <input type="checkbox" name="kantoor" id="kantoor" /> Kantoormeubels</label> <label> <br /> <input type="checkbox" name="kasten" id="kasten" /> Kasten</label> <label><br /> <input type="checkbox" name="keukens" id="keukens" /> Keukens <br /> </label> <label> <input type="checkbox" name="tafels" id="tafels" /> Tafels</label> <br /> </div></td> </tr> <tr> <td height="21" colspan="5" valign="top"><input type="reset" name="reset" id="reset" value="Reset" /></td> <td width="83" height="21" valign="top"><input name="verzenden" type="submit" id="verzenden" onclick="MM_validateForm('voorletters','','R','achternaam','','R','tel','','RisNum','email','','RisEmail');return document.MM_returnValue" value="Verzenden" /></td> </tr> </table> </form> </body> </html> Looks like: afbeelding 1.png Then the PHP code: Code: [Select] <!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>Contactafhandeling</title> </head><body> <? $aanhef = $_POST['aanhef']['dhr']; $aanhef = $_POST['aanhef']['mvr']; $voorletters = $_POST['voorletters']; $achterNaam = $_POST['achterNaam']; $adres = $_POST['adres']; $postcode = $_POST['postcode']; $tel = $_POST['tel']; $email = $_POST[email]; $interesses = $_POST['badkamer']['kantoor']['kasten']['keukens']['tafels']; $formsent = mail('sven_jcvd@hotmail.com', 'Gegevens afkomstig van contactformulier.html', "Naam: $aanhef $voorletters $achterNaam\r\n Adres: $adres\r\n Postcode: $plaatst\r\n Telefoonnummer: $tel\r\n Emailadres: $email\r\n Interesse in: $interesses", "From: $email\r\nBounce-to: sven_jcvd@hotmail.com"); if ($formsent) { echo "<p>Beste $achternaam,<br><br> Bedankt voor uw bericht, we zullen zo snel mogelijk contact met u opnemen.\n\r Met vriendelijke groet, JPS</p>"; } else { echo "<p>Sorry, er gaat iets fout met het formulier, probeer het later nog eens a.u.b.</p>"; } ?> </body> </html> Hi all, I my making a site which to be easier i have made a querystring statement, but the issue is that when accessing /?action= shows index and ?action=register shows register great!, when accessing root / of the site or index.php and displays Undefined index: action , when clearly i have defined action with $id, so why is php saying it is not. I know there is the option for error_reporting(0), but i want to know why this is happening. Edit: the script is, and runs fine other than the error! Code: [Select] <?php $id = "action"; $string = $_GET["$id"]; if ($string == "register") { echo 'register'; } else { echo 'index'; } ?> Many Thanks Hello I am trying to get an action status based on e.g attackers_1 troops. Unfortunately I get nothing when I die the $strikeaction var here is my function and method I use to call it. Code: [Select] <?php function getStrikeAction($id){ $q = "SELECT * FROM `accountinfo_db` WHERE `id` = '$id'"; $res = mysql_query($q) or die(mysql_error()); $player = mysql_fetch_array($res); if($player['siegetech']>=1){ $strikeaction=($player['attackers_1'] * $player['siegetech'] * 120); $strikeaction+=($player['attackers_2'] * $player['siegetech'] * 1200); $strikeaction+=($player['attackers_3'] * $player['siegetech'] * 80); }else{ $strikeaction=($player['attackers_1'] * 120); $strikeaction+=($player['attackers_2'] * 1200); $strikeaction+=($player['attackers_3'] * 80); } $id = $player['id']; $q = "UPDATE `accountinfo_db` SET `strikeaction` = '$strikeaction' WHERE `id` = '$id'"; $res = mysql_query($q) or die(mysql_error()); return $stikeaction; } ?> Code: [Select] <?php echo getStrikeAction($player['id']);?> |