708 Posted Topics
Re: putting html in between the php tags makes it very confusing to me. here is some code I made see if it solved the problem: [code] <?php if ((mosCountModules('user3')) || (mosCountModules('user4')) || (mosCountModules('user5'))) { echo '<div id="pod"><!-- Start Pod -->'; if (mosCountModules('user3')) { echo '<div id="podcol1" style="width:' . $podmodwidth . … | |
Re: i can create a system like that for you if you need it. just let me know. | |
Re: what do you mean groups? you need to go into more detail. | |
Re: I am not exactly sure what you are wanting but I would use this code to insert text into the database [code=php] <?php if (isset($_POST['submit'])) { $page = $_POST['page']; //ID OF PAGE $text = $_POST['text']; //TEXT FOR THAT PAGE $sql = "UPDATE `pages` SET `page_text` = '" . $text . … | |
Re: i use ajax to accomplish this. by using ajax the page will not have to reload and you will only have to submit the form one time to add_article.php. if you need an example let me know and i will post the url. | |
Re: worked perfectly for me. no idea what the problem is. | |
Re: i look over my code again and i can't see the problem. i have used this code a dozen times and never had a problem with it. are you sure its not the server. | |
| |
Re: just assign a checkbox with a different name to each one with id value as the checkbox value. then use the foreach() statement to loop through the post results and regex the key to make sure it belongs to that set of input elements. after that take the value from … | |
Re: you have to GET the string from the get array. try this. [code] <?php $q = $_GET['q']; //make sure you validate this string otherwise i could delete your database with sql injection $arr = explode('|',$q); $i = 0; while ($i < count($arr)) { $sql = "DELETE FROM `aCar` WHERE `aId` … | |
Re: you need the send the content-type header with the script so it will be displayed as html not text. replace: [code] $headers = 'From: ' . $_POST['nombre']; [/code] with: [code] $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; [/code] | |
Hello, I am thinking of creating a php game in my spare time. Any ideas on what the game should be? | |
Re: it would be easier to see the problem if you posted more of your code. | |
Re: i use this code for most of my html in the sites i have developed: [code] $html =<<<HTML any html content contained here HTML; [/code] | |
Re: session variable use session_start(); at the beginning of the page. store the username and password infomration in $_SESSION['user'] and $_SESSION['pass'] and then just echo them on the other page using echo $_SESSION['user']; | |
Re: you would need to use ajax to display the message on the other persons screen. look into it and i think you will find a solution. | |
Re: why do you need to use a server side include? php can read the file and echo the contents. | |
Re: store the username in the session variable as $_SESSION['user'] = $username and then on the other page echo the name using echo $_SESSION['user']; | |
![]() | Re: if i understand correctly, that would take a special configuration of the server itself. |
| |
Re: what exactly are you storing in the database, url wise? more information about this would be helpful. | |
Re: i know i can create you some working code if i understand what you are trying to do more. do you have an online example to look at? | |
Re: don't use the die statement. the html is not being outputted because the nothing is executed or echoed the page after the die statement has been used. put the error message into a variable and echo it inside the html. | |
Re: i have a pagination script i made about 6 months ago for someone on daniweb. i can send it to you and you can modify it to work for you. | |
Re: i don't recommend using the orginal file name. you will run into the same problem over and over again if you upload the same file at all. use the time() function to give each uploaded image a unique name. | |
Re: i would use: [code] <?php $catid = '1'; $sql = "SELECT * FROM `music` WHERE `music`.`catid` = '" . $catid . "'"; $query = mysql_query($sql, $con) or die('Error: ' . mysql_error()); while ($row = mysql_fetch_assoc($query)) { display information } ?> [/code] | |
Re: try [code] $sql = "SELECT * FROM bak_bill_cust"; $query = mysql_query($sql) or die('Error: ' . mysql_error()); $select = '<select name="test">'; $select .= '<option value=""></option>'; while ($row = mysql_fetch_assoc($query)) { $select .= '<option value="' . $row['cust_code'] . '">' . $row['cust_code'] . '</option>'; } $select .= '</select>'; echo $select; [/code] | |
Re: if you are trying to see if a string "contains" a character, i would use a regex and the preg_match function | |
Re: does it matter if the page reloads or not? | |
Re: why don't you just use the get method in the form. [code] <form action="something.php" method="get"> [/code] you could just use this.form.submit() [code] <select name="selectBox" id="selectBox" onchange="this.form.submit()"> <option></option> <option></option> <option></option> </select> </form> [/code] ![]() | |
| |
Re: i suggest using javascript. get the name of the browser using javascript and refresh with the browser name in the url. have php detect it using the $_GET method and show the right code based on that input. the only problem i see is i think most wap browsers will … | |
Re: what exactly is the problem. is there any errors or is the table just not showing up or displaying improperly. | |
Re: use a variable. var test = document.myForm.txtName.value; test = null; if(test == null){ alert('value is null'); }else if(test == 'null'){ alert('value is a string null'); //only this works! } i think this should work, but i didn't test it. | |
Re: you can either use AJAX or have javascript refresh the page with the dollar amount in the url. | |
Re: i think you cannot have spaces in variable names. ex. $Post Code try $Post_Code | |
Re: just add the width and border to the <table> tag. [code] echo "<table width='something' border='1'>"; [/code] | |
Re: you could just open the rss file with php, put the form data into the proper format and append it to the file. | |
Re: there probably is a simpler way but i made this i about 3 mins. [code] <?php $hours = array(11,12,13,14); $mins = array(30,30,30,30); $count = count($hours); $i = 0; while ($i < $count) { $time[] = $hours[$i] . ":" . $mins[$i]; $i++; } ?> [/code] all of the times are now … | |
Re: i just wrote this and it works for me: [code] <script type="text/javascript"> setInterval('ads()', 5000); var i = 1; var array = new Array(); array[0] = 'adImage1.gif'; array[1] = 'adImage2.gif'; array[2] = 'adImage3.gif'; array[3] = 'adImage4.gif'; array[4] = 'adImage5.gif'; function ads() { if (i == 5) { i = 0; } … | |
Re: why are you opening the php statement and closing it so many times. just echo the html within the php, it so much easier to see whats wrong because its easier to read. | |
Re: i didn't make any changes to your code and got a parse error on line 12. The one with the if statment in the while(). you need to work on that. | |
Re: you don't need the "RemoveHandler" stuff. all you need to do is put: AddType application/x-httpd-php .php .htm .html i personally tested this and it works on my own server. | |
Re: validating in php really isn't that hard. i have been using this function for a while. i don't know if it is the best way but it works for me. [code] function check($fieldname) { if(!preg_match("/[^a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\,\ ]+$/s",$fieldname)) { return TRUE; } else { return FALSE; } } [/code] | |
![]() | Re: i don't know if this is exactly what you are looking for, but you could use NetLimiter. i just saw it a few days ago and i haven't really looked into it. ![]() |
Re: try this: [code] <?php include("connectdb.php"); if(isset($_POST['Submit'])){ $id = $_REQUEST['id']; $name = $_REQUEST['name']; $email = $_REQUEST['email']; $tel = $_REQUEST['tel']; $sql = "UPDATE phonebook SET name = '" . $name . "', email = '" . $email . "', tel = '" . $tel . "' WHERE id = '" . $id … |
The End.