Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
20
Posts with Upvotes
19
Upvoting Members
18
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
6 Commented Posts
1 Endorsement
Ranked #858
Ranked #339
~150.23K People Reached
Favorite Forums
Favorite Tags

139 Posted Topics

Member Avatar for T3STO

You woud access it like any other cookie for the site, using the Request.Cookies collection of the Controller class, `Request.Cookies["cookie"]` returns an object for the cookie named "cookie". Use the ToString() method to retrieve the text value of the cookie. Check out the docs here, https://docs.microsoft.com/en-us/dotnet/api/system.web.httprequest.cookies?view=netframework-4.8 for more details.

Member Avatar for madCoder
0
1K
Member Avatar for sassygray5

On line 79 use $conn->query(...) as you did in your other queries. Use the mysqli object you create at the top of your script.

Member Avatar for sensibledurg
0
26K
Member Avatar for soomro_moon

Yeah, that's the gist of it. [CODE=php] <label for="doctor_id">Select a doctor:</label> <select name="doctor_id"> <?php while($doctor = mysql_fetch_assoc($name)) { printf('<option value="%d">%s, %s</option>', $doctor['id'], $doctor['surname'], $doctor['name']); } ?> </select> [/CODE]

Member Avatar for hardik
-1
3K
Member Avatar for aixlu

Some helpful hints when working with HTML checkboxes and PHP. 1. Name the checkbox entries the same and add brackets to the end of the name. This will result in all the selections being stored into an array when submitted to php. 2. If zero entries are selected, the form …

Member Avatar for Natalia_3
0
3K
Member Avatar for davy_yg

The Mailchimp service (http://mailchimp.com/) is a great option. I manage sending announcements for a client of mine and have used Mailchimp for several years. Mailchimp offers some nice services that would take a lot of effort to replicate yourself: * There are several templates to choose from when creating a …

Member Avatar for madCoder
0
239
Member Avatar for sahilmohile15

$_SESSION is a collection of values stored on the web server per visitor, per browser (ie, tied to the browser by a *cookie* that stores a unique *Session ID*.) Values can be stored in $_SESSION for retrieval on the server in your PHP code in subsequent requests. Your code snippet …

Member Avatar for madCoder
0
293
Member Avatar for sfiso27
Re: Mvc

Same as you would in html: html5: `<button id="foo" disabled>...` xhtml: `<button id="foo" disabled="disabled">...` Submit buttons follow the same pattern: html5: `<input type="submit" id="foo2" value="Submit" disabled />` xhtml: `<input type="submit" id="foo2" value="Submit" disabled="disabled" />` For a more detailed example, answer pritaeas' question. In what language do you want to disable …

Member Avatar for madCoder
0
110
Member Avatar for Drempan

Global.asax is a funny thing and can be problematic because of execution order. It looks like this code is in the `Global.asax` file instead of the `Global.asax.cs` file. Try moving your code customizations to the code-behind file, `global.asax.cs`. If there is a problem with the code there, you'll get a …

Member Avatar for Robert_10
0
723
Member Avatar for Mihailo_1
Member Avatar for batoolhussain

What problem are you having? From what I see of your code sample, the original uploaded image *might* display (though I'm not sure what URL is getting generated.) The changes you make to the `Bitmap` are all happening in *memory*. They are not altering the image **file** on the web …

Member Avatar for madCoder
0
246
Member Avatar for James_43

`index2.html` should be named `index2.php` . The PHP interpreter won't be used (by default, anyway) if the extension is html.

Member Avatar for James_43
0
234
Member Avatar for chineerat

In addition to everything @lps says, can you have sql do some of the work in calculating the results you need? You show `$total` which could likely be calculated from a sql query using aggregate functions like SUM(), etc. MySQL is often much better optimized for generating totals than doing …

Member Avatar for bugz313
0
380
Member Avatar for Violet_82

Line 7 of your code should refer to `expenseID.Text` or `expenseId.SelectedValue` (in the case of a dropdown or radiobutton list.)

Member Avatar for djjeavons
0
3K
Member Avatar for coder91

Initially you can simply use drag and drop to drag content files into your Visual Studio project. This automatically adds the files into your project when you drop the files onto Solution Explorer. As @JorgeM points out, if your colleague is responsible for the upkeep of these files, you'll both …

Member Avatar for coder91
0
183
Member Avatar for SpottyBlue

Many of your radio buttons do not have event handlers. You need an event handler for the "enable" and "disable" behaviors. The "checkchanged" event is fired by the control receiving the new selection (not when losing selection despite the event name implying this.) I have found that the RadioButtonList control …

Member Avatar for madCoder
0
2K
Member Avatar for Sumith Asanka

Without seeing some code behind, it's hard to diagnose but a few things come to mind: 1. Make sure the site is running as an ASP.NET 4.x site (it might be set to run 2.0 or 3.5 for example.) 2. How do you know that the events aren't firing at …

Member Avatar for Santanu Das
0
391
Member Avatar for Blueie

Line 9 in the listing above is likely a syntax error. Simply uncomment the H1 element on line 7 for a title heading. You can't have more than one HEAD element in a document. That HEAD element already exists in the master page. Check your master page to see if …

Member Avatar for Blueie
0
834
Member Avatar for Blueie

The webopt:bundlereference is new in .net 4.5. It is bundling ALL the css in your content folder -- including [Bootstrap](http://getbootstrap.com/)! Basically it concatenates the CSS files, minifies it (removes unneeded whitespace) and sends it all out in one go instead of several seperate files. The blue halo seen around the …

Member Avatar for pritaeas
0
1K
Member Avatar for kaziraja

@kaziraja, you can use the String class' Split method. [C#: String.Split()](http://msdn.microsoft.com/en-us/library/system.string.split%28v=vs.110%29.aspx) table2 = new Table2(); // Assumes a Table2 entity exists. string source="1002008000300-53-9" string[] codeParts = source.split('-'); // Assign split values to your table2 entity table2.column1 = Int32.Parse( codeParts[0]); table2.column2 = Int32.Parse( codeParts[1]); table2.column3 = Int32.Parse( codeParts[2]); // Go persist …

Member Avatar for madCoder
-1
123
Member Avatar for AdriftUniform

You can only display one image using this technique. Put the loop in a calling script. This is done with the image tag: [CODE=php] <?php // ... $query = "SELECT * FROM tbl_images"; $result = mysql_query($query); foreach ($result as $image) { ?> <img src="image.php?id=<? echo $image['id'];?>" /> <? } ?> …

Member Avatar for garyrichard
0
16K
Member Avatar for pebesoft

What's in the 300 fields? Are they repeated sets of data? Surely you don't have a table with 300 columns. If you can post your schema we may be able to help better.

Member Avatar for Byzantine
0
12K
Member Avatar for dinhunzvi

In your loop, test each value against the one that was submitted. If they are a match, mark that option as selected: <option value="<?php echo $row['bankID']; ?>" <?php echo ($row['bankID'] == $_POST['bankID'] ? 'SELECTED="selected"' : '');?> ><?php echo $row['bank']; ?></option> * *The `?` is the ternary operator which works like …

Member Avatar for adam.adamski.96155
0
346
Member Avatar for vizz

Use a session variable to keep track of the last viewed record between sessions. Then use MySQL `LIMIT` clause to set an offset and limit the results to one record. [MySQL Select (limit) reference](https://dev.mysql.com/doc/refman/5.0/en/select.html) When you end up with an empty result set, reset back to record one.

Member Avatar for broj1
0
384
Member Avatar for giovannitao

Have a look at strtotime() http://www.php.net/manual/en/function.strtotime.php The manual says it converts an English date but maybe you can find an Italian localized version.

Member Avatar for pritaeas
0
328
Member Avatar for GlenRogers

In MySQL you can use the LIMIT clause [[Select statement Reference](https://dev.mysql.com/doc/refman/5.0/en/select.html)]. You can use `SELECT COUNT` to determine how many pictures are in the gallery. Decide how many images you want on each page, then divide count into pages. All your links (next, previous, #) will need to pass the …

Member Avatar for GlenRogers
0
168
Member Avatar for Djmann1013

I don't see how the $inactive variable will persist between visits. It is not stored in a session variable and it gets reset to 1 (or 600) immediately when the script begins. Could you provide a spec. that describes exactly how you *intend* this code to work?

Member Avatar for LastMitch
0
390
Member Avatar for Riu 2009

Guessing by your description, what you need is a left join: display all learning materials and their evaluations even when there are no evaluations available. A left join lets you select ALL relevant entries from the first (left) table to a second (right) table even some corresponding entries don't exist …

Member Avatar for Riu 2009
0
269
Member Avatar for DarkMonarch

I have found that MySQL is very effective at doing ORDER BY and the like *IF* proper indexes are set up. Indexing makes a HUGE a difference and is often overlooked. The sql EXPLAIN command is very helpful for evaluating how efficiently a query is being carried out. I admit …

Member Avatar for madCoder
0
154
Member Avatar for cguan_77

One technique is to name form fields in a way that will be translated into an array by PHP. Instead of naming the SELECT element "country1", "country2", etc you can name the fields "country[1]", "country[2]" and so on. When the form gets submitted to PHP, it will automatically convert these …

Member Avatar for cguan_77
0
260
Member Avatar for cssweb

Yes. After a form is submitted and processed, you should issue a redirect to prevent the form from being submitted again unintentionally when a user refreshes their browser (or the browser restores previously open tabs during startup, etc.)

Member Avatar for diafol
0
222
Member Avatar for HunainHafeez

@HunainHafeez, you can use `Request.UrlReferrer` to get the referrer server variable. This information is, however, supplied by the browser and is considered to be unreliable. You could also pass along a querystring variable when you redirect that identifies the source page. For example: if (Session["applicantSession"] == null) { Response.Redirect("~/loginApplicant.aspx?source=application"); }

Member Avatar for JorgeM
0
207
Member Avatar for shilu2

Line 3 should get the name of the file instead of the array: $picture=$_FILES['photo_file']['name']; // Gets the original file name.

Member Avatar for jacob.lemelincarrier
0
203
Member Avatar for websponge

The code you posted doesn't print anything. It contains no echo statement and the result of the query, `$result = mysql_query($sql);`, doesn't get stored in a class property that could be printed by another method. PS: A connect() method likely *shouldn't* perform a query or output anything. If you're doing …

Member Avatar for broj1
0
159
Member Avatar for duneflyingyfz_1

It generally seems OK but I couldn't say without seeing the table structure you are querying against. For example, what is the difference between column `date` and column `ftime`? Are you storing date and time into two seperate columns? Also, if `$sysdate` is meant to be today's date, you can …

Member Avatar for duneflyingyfz_1
0
2K
Member Avatar for onofej

> Hello i used the your code but i get this error messageDate 13-12-2012 is trueDate 18/09/2011 is true Fatal error: Cannot redeclare dateCheck() (previously declared in C:\Users\0382\xampp\htdocs\dia\source\Login.php:149) in C:\Users\0382\xampp\htdocs\dia\source\Login.php on line 149 You've declared the function, dateCheck() within a loop. Define the function above the loop. Another point is …

Member Avatar for diafol
0
6K
Member Avatar for karthik_ppts

I haven't tried this in PHP so I don't have any specifics. I usually work with more simple bounding boxes (in Actionscript 3.) In math, what you seek is called a "Point in Polygon Test." Something you can search on at least.

Member Avatar for msgrasser
0
5K
Member Avatar for matanc244

Have PHP tell you what mysql doesn't like: if($result) { // echo success info } else { echo mysql_errno($con) . ": " . mysql_error($con). "\n"; }

Member Avatar for pritaeas
0
128
Member Avatar for mahdiyazdani

Cookies are accessed using the $_COOKIE superglobal and work VERY similar to $_SESSION. The important thing will be to make sure the content of the cookie can't be easily hacked by an intruder since cookies are stored on the browser's computer.

Member Avatar for mahdiyazdani
0
646
Member Avatar for javedshaikm

First, please lose all those <font> tags. They've been mostly obsolete for at least ten years. In the question form, add a hidden form field that includes the question id. That's the only way you'll know which question to test against. Give each radio option a value attribute that identifies …

Member Avatar for diafol
0
177
Member Avatar for hwoarang69

> <form class='form' action='' method='post'> > <b>".$user_name_s." - Add a Comment:</b><br/> > <textarea class='textarea' name='image_des' cols='50' rows='4' maxlength='200' > </textarea> > <pre><input type='submit' class='button' name='submit' value='Add comment' /></pre> > </form> .... Though it seems odd, you can mix GET and POST like this: <form class='form' action='zoom.php?img=<?php echo intval($_GET['img']);?>' method='post'> <b>".$user_name_s." …

Member Avatar for hwoarang69
0
198
Member Avatar for vindom

*"What goes on in Vegas, stays in Vegas."* *What goes on in a IFrame, stays in that iFrame.* I think deletecomment.php is being called and IT is doing a redirect back to admincomments.php but is not passing an `id` in the url (since you just deleted that comment, there is …

Member Avatar for vindom
0
3K
Member Avatar for jersie03

Umm. Not sure where to begin but judging by the question, this seems like a good start: [How Email Works](http://bit.ly/HowEmailWorks)

Member Avatar for jersie03
0
3K
Member Avatar for persianprez

You can use the [explode](http://www.php.net/manual/en/function.explode.php) function to split up each line and create an array. // For each record $record = explode('|', $line); $recordset[] = $record; //...

Member Avatar for madCoder
0
121
Member Avatar for Patiodude

It sounds like you've answered your own question regarding remote connections. You could write a php script that does what you need and put it up on the server.

Member Avatar for JorgeM
0
310
Member Avatar for jobber15

An *if* statement needs to be in a block, seperated so that php knows how much of the following code is included in the condition: `if(condition is true) { doSomething; doMore(); doEvenMore();} butThisAlwaysHappens();` So your code would be something like this: $query = mysql_query("SELECT * FROM employees WHERE flag = …

Member Avatar for jobber15
0
118
Member Avatar for cdogstu99

@tiggsy is correct that this is something the plug-in author has to fix. Cookies cannot be set once output has begun (this is fixed/changed in the newest versions of PHP) because they must be sent as part of the HTTP headers that get sent at the TOP of the output. …

Member Avatar for madCoder
0
351
Member Avatar for BenzZz

You can, dynamically output anything that will end up in the final HTML document, including style tags or style attributes to tags. For example, this is commonly done to achieve "Zebra Striping" in table rows. [CODE=php] //... $ctr = 0; foreach($dbResults as $record) { $rowColor = $ctr %2 ? '#cfc' …

Member Avatar for Ausopenxcell
0
154
Member Avatar for n3xtgen

Be sure to add an action to your form so it submits to the second script: [CODE]echo '<form method="post" action="script2.php"><input type="hidden" id="memberIdd" name="memberIdd" value=' . $memberId . '></form>'; [/CODE] You can then access the value as $_POST['memberIdd'].

Member Avatar for hakeemtunde
0
6K
Member Avatar for ptara1

I took a closer look at the mysql Time datatype ([url]http://dev.mysql.com/doc/refman/5.0/en/time.html[/url]) Time represents elapsed time, not time of day; so the hours part can exceed 24. You could represent "02:00 the following day" as '26:00' for your closing time. Also, the day of the week can be represented as a …

Member Avatar for ptara1
0
209
Member Avatar for puvi

@puvi, radio buttons will only return one value so you don't need the array braces in the field name. That technique works great for checkboxes and multi-select dropdown lists. You can retrieve the value as $_POST['a'] as a string. As your code stands now, you will receive an array. [CODE=php]<input …

Member Avatar for jmichae3
0
2K

The End.