98 Posted Topics
Re: If the file that is being 'got' by file_get_contents() has the extension '.txt' will the server parse the file as PHP? Change '.txt' to '.php' and see if it helps. If you want to keep the extension as .txt, and still have the file parsed by the server, you could … | |
Re: I see no reference to "%i" in the [manual](http://uk1.php.net/manual/en/function.sprintf.php). | |
Re: `if($_POST['var']){`if there is no post[var] defined, I get the undefined index error. `if(isset($_POST['var'])){`I get no error. Also in this case I think the [ternary if](http://davidwalsh.name/php-shorthand-if-else-ternary-operators) syntax would be useful: `<?php echo (isset($_POST['email']) && empty($success)) ? $_POST['email'] : "";?>` | |
Re: [file_get_contents()](http://uk1.php.net/manual/en/function.file-get-contents.php) to get the whole csv file into a string. [explode()](http://uk1.php.net/manual/en/function.explode.php) the string on new line character giving many single $line strings. foreach loop through all $lines: [explode()](http://uk1.php.net/manual/en/function.explode.php) the $line on ',' into $pieces foreach loop through $pieces. if first $piece of line, check value: if holds value like "Product … ![]() | |
Re: You need to use a while loop: while ($row = mysql_fetch_assoc($result)){ //echo your HTML } http://uk1.php.net/manual/en/function.mysql-fetch-assoc.php ![]() | |
Re: Is this a JQuery issue? I noticed in JQuery mobile that pages are not truly loaded, and any GET vars are lost because the pages are loaded by ajax. Also this is a JQuery dialog that he is trying to pass the ID to I think. It seems the OP … | |
Re: I think you need this function: http://uk1.php.net/manual/en/function.str-replace.php ![]() | |
Re: Look here: http://www.php.net/manual/en/ref.filesystem.php specifically `fopen()` | |
![]() | Re: If the browser is navigating to a pdf file, it will probably try to open it with the browser plug-in unless the browser's own config tells it to pass the file to the system default application. If you offer the browser the file for download, I imagine the user will … |
Re: I would highly recommend sanitising the data before input, using an if test to check $_POST exists before any DB operations, taking the post vars and assigning to new variables. I don't think '$_POST[key]' is going to parse correctly either: $name = mysql_real_escape_string(trim($_POST['name'])); $address = mysql_real_escape_string(trim($_POST['address'])); $sql = "INSERT INTO … | |
Re: PHP is not like Javascript, it is parsed by the server before the script is loaded in the browser. Once the page is loaded, PHP is finished until the next script load. If you want PHP to do anything in response to user input/action, you need to collect data using … | |
Re: Your code looks good to me, I have read it all through and can't see any mistakes. I replicated your list of checkboxes and ran it and it works fine, returning an array because you named the elements with [] (unlike the poster above). How are you testing the value … | |
Re: Sorry if I am patronising, but are you sure your server supports short tags (line 120)? `<?= "blah blah" ?>` won't work on some servers, `<?php echo "blah blah"; ?>` works on all. Can we see the page? | |
Re: http://php.net/manual/en/function.xml-parse.php I think the second user contributed note (Ashok dot 893 at gmail dot com) might be what you are looking for. | |
Re: Hey there, you want to use the audio tag? I had a play with the w3schools page try-it: http://www.w3schools.com/tags/tag_audio.asp Using the editor I used this code - <!DOCTYPE html> <html> <body> <audio autoplay="true"> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mp3"> Your browser does not support the audio element. </audio> </body> </html> … | |
Re: How are you stumped? What did you try? If you use a select menu for the choosing of the .pdfs to be merged, and a submitted form to carry the choices to a processing function it's relatively simple. You need to use javascript for the drag and drop, and to … | |
Re: If you click on one of the topics in this forum and start to type a response, and then try to navigate away from the page using the browser's back button, a javascript alert pops up verifying that you want to leave the page or stay on the page. Maybe … | |
Re: So the new row is inserted before the page is built, and PHP writes the result (success/failure) to a hidden form element. Use <body onload=""> to activate a javascript fucntion that shows the image for desired amount of time. Or use ajax to insert data via a separate php file … | |
Re: It's possible using Javascript. Add the onblur event to the text box and attach it to a function that replicates the textbox value in the textarea. | |
Re: It means that for each search for love that exploded in our faces, there is love searching for each of us. | |
Re: Ok, but both IF statements have the same OR clause (!== ''). Which, if evaluates to TRUE will mean your other condition (!isset) isn't tested. ![]() | |
Re: Line 124 tells the script to die before showing the form. ![]() | |
Re: I wrapped your code in an ajax function, and made the xml file, and it alerted Ben on all three browsers (IE, FF, Chrome) - http://www.zigstum.com/randoquote/dani.php Do you have no error console to debug javascript? | |
Re: > the Email don't go at all to the users Does this mean that no users ever get an email? Or does it mean that not all users get a mail, but some users get a mail? | |
Re: The email variable is posted in the URL so can be accessed via $_GET['ID']. | |
Re: https://developers.google.com/+/api/ https://developers.facebook.com/docs/guides/web/ | |
![]() | Re: Hmm, that's interesting :D I'm sure there are better ways, but I would log the user's IP Address and browser agent on login either in a DB, a session variable or in a separate text file, and every time they try to perform an action, check to see if they … |
Re: php might be involved but to display something on page for a few seconds is a task for javascript so maybe you need to start this thread in that forum to get the best chance of a relevant and timely answer i also recommend using punctuation in your post as … | |
Re: Hey there, you really need to learn this step by step. The first page is the form page that allows the user to select the file that is to be deleted. This page will have a submit button which when clicked will redirect to the URL specified in the action="delete.php" … | |
Re: You can search google for 'beginner PHP tutorial'. The first result is the 'simple tutorial' on php.net website. If that is too hard, you need to grow your brain :D Good luck! ![]() | |
Re: Line 30: $query = 'INSERT INTO country_wise_products (coutry_id, product_id) VALUES '; should be country_id (the 'n' is missing from country). But why no error to screen (unknown column)? Is there a file error_log in the folder you are running the scripts? | |
Re: SELECT NULL FROM awards **AS** v ? ![]() | |
Re: The table opening tags, the header cells and the table closing tags need to be moved outside the while loop. | |
Re: I think the 'wages' the error message refers to is the $_POST['wages']. The **key** ('wages'), as the error states, does not exist in the $_POST array. <?php $errorcount=0; //add the following line to see if the $_POST array exists and what it contains. print_r($_POST); $wages=$_POST['wages']; $hours=$_POST['hours']; | |
Re: I did the same thing that you are trying to acheive by using a function in an includes file that would work out and set a few page variables on page load just as Arctic said. It's not the browser that looks for either .php or .html, it's the webserver … | |
Re: I think the OP wants to know if he can store a PHP variable and a text string, in the mysql field. Presumably so that when he selects the data from the dbase, PHP parses the variable and changes it for the current date. | |
Re: I would guess that on line 38 of confirmation.php it says 'mysqli_stmt->' instead of '$mysqli_stmt->', but it would be better to see the file that gives the error. | |
Re: Anna, it's hard to work out what you actually want to achieve. It seems to me that you want to grab the selected size from the add to basket page and then carry that size onto the basket page and show it there also. In which case, you simply need … | |
Re: I think what Bachov is suggesting is that you have the file onlineand available for download, and you put the URL to the file into the body of the email. This is certainly the simplest way, but if you really want to send the file as an attachment these are … | |
Re: You need to use the string functions of php - http://php.net/manual/en/ref.strings.php - specifically, strpos, strlen, substr. Is this '$html->find('li') method part of a defined class? I think javascript is more suited to looping through DOM elements and grabbing the href location. | |
Re: Can you not echo any errors to the screen? $sql = "INSERT into test (idnum,title,content) VALUES ('$id','$title','$content')"; if (!$resulta = mysql_query($sql)){ echo mysql_error(); die(); } If not, can you not read the error log? | |
Re: You can use Javascript to capture the onlcose event of the window and request that a user logs out properly, look at this page for instructions: http://royaltutorials.com/javascript-popup-onclose/ Also, you can have another field in your DB that records the time of the last action of the logged in user, and … | |
Re: The problem is with the `$_GET['error']` variable - in one place it is `$_GET` in the next palce it is `$GET` without the underscore. You need the underscore in both instances, `$GET` is not the same as `$_GET`. Also you *can* send the message via the URL (the get method), … | |
Re: `$your_email ='<" .$_GET['ID']. ">';` Your mistake was to mix the double and single quotes - `"<" .$_GET['ID'] .">"` works, and so does `'<' .$_GET['ID'] .'>'`, but not the mixture that you have. You really need to learn how to concatenate strings as you have to do this very often in … | |
Re: $data_email_sender->AddToAddr("name<" .$_GET['ID']. ">"); You don't need to echo the GET var as you are already in a PHP block. Or for tidiness, you can build the string separately - $str = "name<"; $str.= $_GET['id']; $str.= ">"; $data_email_sender->AddToAddr($str); Hope this helps. | |
Re: Look at the fopen() and fwrite() functions: http://uk.php.net/manual/en/function.fopen.php / http://uk.php.net/manual/en/function.fwrite.php ![]() | |
Re: You have $**c**lient: $client = new SoapClient("http://localhost:8731/phpwcf/?wsdl"); and $**C**lient: $response = $Client->ENtoJP($args); | |
Re: The empty form action will leave the action as the current page, like using $_SERVER['PHP_SELF'] and will make no difference to header("Location:index.php"). I replicated your setup: <form name="form" method="post" action=""> <input name="submit" type="submit" value="submit"><form> on one page, and <?php if(isset($_POST)){ header("Location:newpage.php"); die(); } ?> on the included page, and it … |
The End.