812 Posted Topics
Re: Split on what condition? Give an example of a session variable you have and how would you like to have it split. ![]() | |
Re: You use `to` as the field name but `to` is also a mysql reserved word. So if you realy want to use it for a field name, enclose it in backticks like this: ..., `to` = "' .$to. ... Better practice is to completely avoid using keywords for field names. … ![]() | |
Re: Just give the `title` attribute a correct value to display the description. In your case line 7 would be: echo '<div class="imageObject"><img src="ressources/images/objects/', $P_Element, '.jpg" width="150" height="150" hspace=0 vspace=0 title="', $T_Description, '"/></div>'; provided that the `$T_Description` variable contains the actual description. | |
Re: Depends on how you display the icon. One way of doing it is using a CSS background property: div.ofsomeclass { background-color: #FFFFFF background-image: url("some/location/marker-green.png"); background-repeat: no-repeat; background-position: letf top; } Now define the hover pseudo class: div.ofsomeclass:hover { background-image: url("some/location/marker-blue.png"); } Should work OK in modern browsers (not IE6/IE7). There … | |
Re: In my opinion and experience the answer is yes. I know of one organization that uses xampp on a windows server for an intranet app that serves say a hundred users and they are all happy about that. You have to be aware of a possible decreased performance with large … | |
Re: Insert this simple debug code after line 115: die($q); It will display the query as it has been constructed and stop the script. Now you can inspect the query and paste it into phpmyadmin to check it if it works. You can post it here also. You took the complex … | |
Re: Just to clarify - the string can actualy be one of the values below: $stringExample = '((823584X80X998.NAOK == "1"))'; $stringExample = '((823584X80X1001.NAOK == "1" or 823584X80X1001.NAOK == "2" or 823584X80X1001.NAOK == "3"))'; If that is true, you have to: - get rid of all the parentheses - explode by `OR` … | |
Re: You can get some user agent strings [here](http://user-agents.my-addr.com/user_agent_request/user_agent_examples-and-user_agent_types.php). | |
Re: The if statement has an error. Instead of assignment operator `=` you should use comparison operator `==`, like: if ($row['question_type'] == 1) In the form html code you are missing some quotes (altough this should not be critical): echo '<td>'. '<input type="'.$type.'" value= "'.$row['question'] . '" </td>'; | |
Re: Enclose each row (and ID and a delete button) within form tags and add a hidden input that holds the value. You will have as many forms as there rows. When you delete (submit), the value in the hidden input field will get over to the next script. And you … | |
Re: Have you tried a full path, like: $pdf->Image('a.jpg',20,65,20,0,'','http://yoursite.com/yourpath/searchstudentavailability.php'); | |
Re: Sort result rows by timestamp. See comments in the code for the rest: // initialize current timestamp to 0; $currentTimestamp = 0; // initialize current array that will hold the result $resultArr = array(); // loop through the result // (this example is for PDO, change to whatever driver you … ![]() | |
Re: The select elements have to have name attributes and be enclosed in form tags containing the action and method attributes in order to properly pass the values to the server. Something like: <form action="process.php" method="post"> <select class="pais" name="sel_pais"> <option value="1">Argentina</option> <option value="2">Chile</option> </select> <select class="provincia" name="sel_provincia> <option value="1" class="1">San Juan</option> … | |
Re: Where do you initialize the `$HTML` variable so you can concatenate to it? // initialize $HTML $HTML = ''; foreach($records as $row) { $HTML.='<div>'; $HTML.= $row['State']; $HTML.='</div><br/>'; } Also the `PDO::PARAM_INT` value in the binding part should be `PDO::PARAM_STR`, since you are actually binding a string type. $query = "SELECT … | |
Re: First: do not use GET for the form method, use POST. When using GET, passwords will be visible in the URL bar of the browser and will get written in the browser cache and history. This way anyone with basically no web dev skills will be able to see usernames … | |
Re: Did my answer from [your other thread](https://www.daniweb.com/web-development/php/threads/494085/php-excell-img) not help you? I have provided a tested working example there. | |
Re: Depending on how your overall approach is to processing form data, but in general it is as easy as: if(empty(trim($_POST["Title"])) || empty(trim($_POST["Author"])) || empty(trim($_POST["Content"]))) { echo "You forgot to enter some required data"; // go back to the form } else { // // I HOPE YOU DO SOME FILTERING … | |
Re: You could make it simpler by using `file_exists` instead of using all the `scandir` stuff: $p = $_GET['p']; // WARNING: sanitize this before using it in production app if (file_exists($dir.'/'.$p.'.htm')){ include($dir.'/'.$p.'.htm'); } else { echo 'Sorry, page introuvable'; } And sanitize user input (such as limiting it to certain path, … | |
Re: This code: public function get_validator(){ return $this->response_code; return $this->response_msg; } should be probably broken into two methods: public function get_response_code() { return $this->response_code; } public function get_response_msg() { return $this->response_msg; } I have been using OOP approach for several years now, and must say that it helps a lot. I … | |
Re: I copied the files form the attached zip and everything works fine. Json gets displayed in the `jsonReadArea` div. Have you checked all permissions are OK? | |
Re: Must be an issue with quotes. Try something like this: curl -i -H "Accept: application/json" -d '{"username": "divmesselibrary", "password": "677Sure1@"}' or: curl -i -H "Accept: application/json" -d "{\"username\": \"divmesselibrary\", \"password\": \"677Sure1@\"}" | |
Re: The $result does not contain the rows from the database yet. It is just a special PHP type variable that enables fetching of rows. So you have to fetch rows, usually in a loop: The following is an example using [mysqli](http://php.net/manual/en/intro.mysqli.php) object oriented way: $username = "USERNAME"; $password = "PASSWORD"; … | |
Re: Post the code you have so far and describe where exactly the problem is. Also, please read [this](https://www.daniweb.com/web-development/php/threads/435023/read-this-before-posting-a-question). | |
Re: You might want to try the HYPERLINK() formula. Haven't tested this, just looked up some info on the net. See also [this link](http://www.devshed.com/c/a/PHP/PHP-Excel-Customizations-Working-with-Formulas-and-Functions/). | |
Re: Is the code <a class="showallphoto" href="'.$base_url.'login.php?showallphoto=' . $messageid . '" style="cursor:pointer"> echoed by a PHP script? If yes, show the whole line. Also test if the link gets constructed OK (by inspecting the generated code, by hovering with the mouse over it and checking the status line etc). | |
Re: The error message is saying that the value of `$row['callback_function']` is an array and can not be cast to string. In order ot find out what the value is when the error occurs you have to do some simple debugging (if you are not using a proper debugger). Put this … | |
Re: You can store the value in a hidden input field in the form which will then be picked up when form is submitted. <input type="hidden" id="hidden-date" /> And in the javascript I guess you change line 21 to: document.getElementById('hidden-date').value = document.getElementById('time').innerHTML; | |
Re: The error is in the paramaters of the `mysql_query` function. The first parameter should be the query (string type), and the second (optional) parameter is the link (of type resource type). You have wrong sequence ot these parameters. And the mantra: ditch the deprecated `mysql_*` functions and replace them with … | |
Re: It seems that the `$topuid` variable is not an array (the implde function expects an array). Can you check it out? You can put this code just before line 3 in the above code: die(print_r($topuid, 1)); This will display the value of the variable and stop the script. Please post … | |
Re: You have to debug ajax calls which is easier with tools like Firebug. But anyway, I think you should check the UPDATE query from the `updateMemberAjx()` function. You can try to display the query instead of the success message by assigning the query to a variable in each case statement … | |
Re: And what is the actual problem? Describe where you got stuck and post possible error messages. | |
Re: The problem might be occuring at the time of saving pictures in the database (there are two photos in the folder but only one in the database). Post the code for saving the data into the database (I have a feeling that the insert query should be within the for … | |
Re: The values you are trying to display have no values so you see nothing. To prove that add some static texts to the echo statement, like this: foreach ($array as $values) { echo 'AUTHOR FL: ' . $author_fl = $values['show']['showCovers']; echo 'BOOK_ID: ' . $book_id = $values['books']; echo 'TITLE: ' … | |
Re: You can store number of images per row in an array (this is untested, just a concept): // between lines 17 and 18 - initialize variables $rowNo = 1; $imagePerRow = array(); // between lines 44 and 45 - assign current value for that row imagePerRow[$rowNo] = $x; // on … | |
![]() | Re: On line 14 you are calling the `Voucher` method which expects two parameters: the object of the `Registry` class (first parameter) and the voucher code (second parameter). You supplied only one parameter, which should be the second one. Hence it is of wrong type. Supply both parameters (and both of … |
Re: Your text contains an apostrophe (`'`) which is also used in mysql as a string delimiter. In order to store an apostrophe into the DB you have to escape it usually using a database escape function (mysql_real_escape_string in your example): $insert = mysql_query("insert into offer( descr ) values( '".mysql_real_escape_string($descrr)."' )") … | |
![]() | Re: You are mixing `mysql_*` and `mysqli_*` functions as well as object oriented and procedural style. The code below is `mysqli_*` OOP style, and is not tested, just to give you an idea. See the comments. // check if form submitted and if code field is not empty if(isset($_POST['submit']) && $_POST['code'] … |
Re: I presume $user is the object instatntiated from the class that contains the selectData method. I am guessing that this class stores the results (array, object...) into some properties. Now, you should use correct operators to address those properties, such as: echo $user->aarrayResultProperty['P_id']; ... And also: $QUERY->Fetch_Assoc; I do not … | |
Re: Te index file should have a php extension only if you have some PHP code in it. Also your web server should have all the neccessary modules instaled and enabled. Which web server are you using? | |
Re: Your for loop gets repeated only two times. Did you mean you want to display an ad every 10th match? | |
Re: Please post the whole class structure not only one method. $Fetch_Assoc, $Fetch_Array, $Num_Rows and $Fetch_Object should be either assigned to some properties or somehow returned by the function. There is a third option which is that these variables were made global but that would defeat the purpose of OOP. An … | |
Re: Writing into a text file could be problematic if you have more than one concurent writing attempt (e.g. two users trigger an error at the same time). With database logging the DB server takes care of queing writes. Also the contents of text files tends to be more clumsy to … | |
Re: In my view the concept you used is OK. I am assuming the form and the PHP code are in the same script. So user can fill in the form to find data from previous months or just leave it blank and get data for the current month. There are … | |
Re: Does the `is_category(10)` function return true? Test it this way: if(is_category(10)) { echo do_shortcode('[smartslider2 slider="14"]'); } else { echo "Error detecting the category page"; } Now, if it returns the above error message post the `is_category()` function code. | |
Re: You are almost there. Just remove quotes arround the row elements, add quotes arround row element names, add semicolon at the end and use `<?php` start tags: <?php echo $row['den_material'];?> You might also want to check for errors: if($result = mysql_query($order)) { // do the stuff... ... } else { … | |
Re: You will have to use Javascript for this. The `confirm` dialog box will be the one to use. See: http://www.tizag.com/javascriptT/javascriptconfirm.php. https://www.daniweb.com/web-development/php/threads/34967/how-can-i-make-php-alert-pop-ups-just-like-in-javascript- | |
Re: You can check your server side sript if it works OK. Try to input the URL with the parameters into your browser directly e.g.: php-includes/news_letter_send.php?name=somename&[email protected] You will have to change the global array to $_GET temporarily: if(isset($_GET['name']) && isset($_GET['email_address'])) { $name = $_GET['name']; $email = $_GET['email_address']; ... } else { … | |
Re: Your message/notice/title says: Undefined index in php file, but you posted only HTML code, no PHP code. Please post the relevant PHP script that triggered the error (probably the formdata.php, but only you can know). | |
Re: This could be quite a complex task and I think you would need some server side scripting (such as [PHP](http://php.org/)) and a database (like [mysql](http://www.mysql.com/products/community/)). You would also have to look at the PHP forum here but I guess you might get some experience or get someone with PHP and … | |
Re: It is much easier to check the query if you do not use all the concatenation. You can do it this way: $sql = "INSERT INTO `kladilnica` VALUES ('', '$getUsername', '$betAmouth', '$gain', '$date', '$match1', '$match2', '$match3', '$match4', '$match5','$match6', '$match7', '$match8', '$match9', '$match10', '$match11', '$match12', '$match13', '$match14', '$match15', '$match16', '$odd')"; You … |
The End.