- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
48 Posted Topics
Re: Not really No. PHP is a Server-Side language, and it is processed on the web server before it is pumped down to the client's browser. It will always run off the web server. | |
Re: Do you mean something like this? [URL="http://www.spreadfirefox.com/en-US/worldrecord/certificate?participant=DaniWeb&state=post"]http://www.spreadfirefox.com/en-US/worldrecord/certificate?participant=DaniWeb&state=post[/URL] If so, I'd love to know how this is done myself! | |
Re: Sorry, I half read this post but is this what you're looking for? [CODE] // Creating the array. $selected = array(4, 3, 9); // Join the array elements into a string, seperated by commas. $result = implode(",", $selected); // Output the result. echo $result; [/CODE] | |
Hi everyone and thanks for reading! I use JavaScript to create sets of text boxes on the fly. I also have a hidden counter in a text box on the form which I also post to my PHP script. This hidden counter is how I tell PHP how many text … | |
Hi everyone and thanks for reading. This problems been driving me nuts for the last day and I'm completely stuck. I made a dummy table of users to test out SQL connections but everytime I echo out the information, it keeps dropping the first record, and jumps straight to record … | |
Re: Hi Smurf_UK, The first thing I should note is that when you post an array of html checkboxes, they'll appear as an array of checkboxes when PHP gets a hold of them. So the first thing you could do would be this: [CODE] $workStyle = $_POST['work_style']; var_dump($workStyle); [/CODE] What you'll … | |
Re: [QUOTE=buddylee17;634398]Use substr to get the first 20 characters of the string: [code=php] $first=substr($content,0,20); print $first; [/code] In this example, $content is the original paragraph, 0 is the starting point of the content to be returned, and 20 is the number of characters to be returned.[/QUOTE] That's very handy to know, … | |
Hi all, hopefully my question is simple as I'm fairly new to OOP coding. I've found an RSS Parser on the internet (which is open source and I can adapt it to however I please yada yada). I want to hide certain variables. [CODE] <?php # RSSParser ## Using the … | |
Re: Hi Andrew, if you wanted them all into one string variable, you could do this: [CODE] // Bind the posted array of checkbox elements to a variable. $service_needed = $_POST['service_needed']; // We use implode to separate the array with a comma and a space. $allCheckboxes = implode(", ", $service_needed); // … | |
Hi guys, this is a brainteaser for me and I'm wondering if you could help. Lets say I'm looping through these results from MySQL, and the result set is as follows: ID------Name 4------ Anthony 76------John 31------Andrew 98------Sonia If I was on the 2nd row (with an id of 76, name … | |
Re: Hi there, I think the problem is the syntax in those conditional statements. In PHP, one equals sign sets a variable, but in this case you're wanting to compare two variables. This is done by two equals sign and your code should be like this: [CODE] if ($genre == "other") … | |
Hi everyone and thanks for reading. Up until yesterday I was unaware of this technique, and have always just ran a user's password through md5 and stored the result to the database. From what I've been reading about SALT it sounds like a very cool way of making your passwords … | |
Re: Correctly posted above! Another way would be to do the following: [CODE] // Sets $stringData to contain $myname. $stringData = $myname; // Takes whatever is in $stringData and adds a semi-colon and a space. $stringData .= ": "; // Takes everything so far and then adds the message, followed by … | |
Hi everyone and thanks for reading. I'll give you a quick insight into my project and desired goal. I've a client who wants a purchase order system that will send purchase orders in the form of emails, and log them into a database. PHP and SQL are my core skills … | |
Re: Hopefully this should get you started. I've commented the code to make understanding easier, let me know if you've any questions; I'm here to help! [CODE] <?php session_start(); if (isset($_POST['submit'])) { // Connect to the database or die. $connection = mysql_connect("DB-ADDRESS", "USERNAME", "PASSWORD"); if (!$connection) { die("The Database connection failed. … | |
Re: Perhaps I've misunderstood the question, and the two previous posters used regular expressions but I would normally test a date with something like the following: [CODE] function is_date($value) { // If the value of the field is empty, immediately return false. if (empty($value)) { return FALSE; } // Attach the … | |
Re: Generally when you want to automate a PHP script, be it big or small you run it in a CRON job, so that's what I'd recommend but I'm curious to see what any other peoples input will be! | |
Hi everyone and thanks for reading. I started a project a while ago and am stuck on how to proceed processing this form. It's a very simple form but I'm still at a mental roadblock regarding how to proceed from this point. The idea is that the form is a … | |
Hey everyone. I was reading the documentation for this function and I can't understand what the example is doing, and how it's working. Can someone explain to me what these functions are doing? [CODE] <?php function odd($var) { return($var & 1); } function even($var) { return(!($var & 1)); } $array1 … | |
Hi everyone and thanks for reading, Now that I've been getting my hands dirty with PHP a lot more, I've been starting to freelance and I'm wanting to make sure I have the right systematic approach to protecting data before I commit to any projects. Whenever we accept user input … | |
Hey guys hopefully this is just a quick question. I've a form that is sending data to a PHP script. The form has the following textbox: [CODE] <input id="quantity1" name="quantity1" type="text" value="" /> [/CODE] Whenever it is posted I do the following: [CODE] function isInteger($val) { if (is_int($val)) { return … | |
Hi everyone and thanks for reading! I've been handed a freelance job to make a purchase order system for an interior designer. Currently whenever they run out of stock they use a spreadsheet to generate a fax like page, print it and then fax it off. She now wants this … | |
Re: The above posters are correct, it's looking for a variable passed to it through the address bar. If this is user data make sure you that the function "secure_input()" is properly sanitizing the information. What php functions is this function using? | |
Hi all and thanks for reading. I came accross a function on the internet for creating a <select> box out of an array. I understand all of the code except for a few things: [CODE] <?php function dropdown($name, array $options, $selected=null) { // Begin the select tag. $dropdown = "<select … | |
Hi all, I have a question about mysql_real_escape_string. Is it just used for login scripts or is it also used for inserting data to a database. My problem is this: [CODE] $connection = mysql_connect("*****", "*****", "*****"); $database_select = mysql_select_db("*****", $connection); $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $firstname = stripslashes($firstname); $firstname … | |
Re: Hey mate, how about using something like: [CODE] $_SERVER['SERVER_NAME']; [/CODE] That'll give you the root directory so if it was used in conjunction with this site, it would show: [url]http://www.daniweb.com[/url] Is that any good? | |
Re: That's a helpful thing to remember Atli. Also just for future reference, let's say you have some checkboxes such as the following: [CODE] <fieldset> <legend>Optionals (Un-Related Checkboxes):</legend> <label for="mailingList">I would like to be added to your mailing list:</label> <input type="checkbox" name="mailingList" id="mailingList" value="Yes" /> <br /> <label for="thirdParty">I agree to … | |
Re: Hi there, Your syntax seems fine. Can you give us an example of what that record would look like in your database? Also, whenever you run that script and look at the source, what is the src of your image tag say? The problem could be the database connection in … | |
Re: [QUOTE=gpdrums;684397]I want to redirect authenticated users to a personal account page where they will see links to pdf documents in their folder. 1. How do I perform this redirect? 2. How do I call the file names for the documents in the account folder? Thanks much![/QUOTE] Hi. We'll need some … | |
Re: What are the values you've set for the checkboxes, can you show us the HTML for your checkboxes? Oh and try to use code tags when your posting code. | |
Re: Do you just mean entering them into text boxes and you want PHP to add them up whenever you submit? | |
Re: You could use a plugin editor like TinyMCE which will handle the line breaks for you. Google TinyMCE and see if thats any use to you. | |
Re: You can upload a file directly into the database, or you can store it's path or location in the database, and use that. I personally recommend the second option, it's fairly easy to do and there's a lot of file upload tutorials that you can follow. Do a search for … | |
Re: Although you've probably got it up and running by now, I'd reccommend looking over some of the tutorials at [url]http://www.php-mysql-tutorial.com/[/url] | |
Hi all and thanks for reading. I have a simple script that works in IE and Safari, but not FF. Basically when I click a button I want an image to appear dynamically via JS. This is what i've got (watered down) [code] **JS function called Contact** var loadingImg = … | |
Re: You'll definitely want to look into movie clips. They are what any good flash project use. I would recommend you stuck to ActionScript 2 for the start, because it's far more covered than ActionScript 3. The flash built-in help is great, and very easy to use. Also, try these two … | |
Re: Silly question I'm sure but have you got both your connection and select database strings? i.e. mysql_conn and mysql_select_db ? Anthony | |
Re: [QUOTE=tech_consultant;642402]Just delete the line: $row = mysql_fetch_row($result); i guess it will solve your problem :)[/QUOTE] That's correct, if you delete that line it will work fine. The problem is that you were using mysql_fetch_row twice, and you were moving the internal pointer onwards, so you were always missing the first … | |
Re: It's probably best if you provide a sample of the code; it lets us see exactly how you do things and give you better advice. | |
Hi everyone and thanks for reading. I've been making a news section for a client's site and now I'm trying to make a little box for the front page to show the five latest stories. Everything is fine in that aspect; I know about using the LIMIT keyword in the … | |
Hi everyone, and thanks for reading. I've a client who will be wanting an events/news section for their website and I have a question about handling this information from a database. Lets say that the table consisted of: [CODE] story_id - To make each story unique. title - The title … | |
Hey everyone, I'm making a login system (in an attempt to advance my PHP knowledge). I've successfully made a system which registers the user (and uses md5 on their password), and also a login page which queries the database on the login info they supply (with the supplied password also … | |
Re: I'm not sure if you meant aesthetically or not but I would take your header and footer, and make them repeat so that they take up all of the width of the page. It's quite easy to do with yours since it's 2D graphics. After that I'd centre the content. … | |
Hi everyone and thanks for reading. I'm having problems validating the file size of my uploads. With my current script, If I upload anything that is over 2Mb, I keep getting the error about file types rather than the ones about the file size. Even if I dont submit anything, … | |
Re: Thats one I'd like to know myself. My initial thoughts would be to play around with the command: $_SERVER['HTTP_REFERER']. However I do not think this would work because the browser history is client-side, and the php would be server-side. There's a 99% chance I'm talking rubbish but I'm sure a … | |
Hi everyone and thanks for reading! I have a MySQL database with a table called "lessons". Inside lessons there are about six or seven fields holding information about piano lessons. The table looks like this: [CODE]vid int(10) (Primary Key) title varchar(50) date date teaser varchar(500) description varchar(2000) vurl varchar(50) extra … | |
Hi everyone and thanks for taking the time to read. There's a specific section of my website that I would like to be dynamic. It has the possibility of having one or two paragraphs, possibly even more. What I had done was set up a MySQL database with a field … |
The End.