|
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
The Code Project | Co-founder
Microsoft C++ MVP
|
|
|
|
|
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
|
|
|
|
I have been reading that HTML6 will be described by some as a "living document" in that it will be open to changes and upgrades over time. If a web page is developed a year or two after the release of HTML6 and if the web page uses updated criteria, then that might break under some conditions.
If that web page uses scripts (example google tracking scripts, and others) that were written to require a previous version of HTML6, then that might not work.
If those scripts were written a year or two after that web page was created, and if those scripts require upgraded HTML6, then that might not work.
I think that the need to be seen as unique, while still being seen as like everyone else, has in the defining of HTML6 as changeable been a bad choice.
Further, what about server side scripts that are not at an update level with the main web page that they are running on? That might not work so well.
I have been wrong before. I can accept wise answers.
Thank you.
|
|
|
|
|
Hello, I want to create a section on my website where I have a background image with missing parts and when the user scrolls down more parts of the image reveals the more they scroll the fuller the image becomes. I have searched everywhere but I haven't found anything on how to do it.
This website [^] I am looking for something like this when you scroll.
|
|
|
|
|
I'm quite new to PHP. I have a selection dropdown, which sends the data to the phpmyadmin database.
This works fine, but I'd like it to be selected as default when I'm opening it again.
Here is how my code currently looks like:
<select name="category">
<?php while ($category = mysqli_fetch_assoc($categories)) : ?>
<option value="<?= $category['id'] ?>"><?= $category['title'] ?></option>
<?php endwhile ?>
</select>
What I have tried:
<option value="<?= $category['id'] ?>"><?= $category['title'] ? "selected" : ""?></option>
I basically just inserted "selected" into it, but it's not the correct way, because every single option is shown as "selected".
Here is an image about the frontend:
https://i.imgur.com/I2cXYrN.png[^]
Does anyone know how to make it to work?
Thank you for being here! 
|
|
|
|
|
|
Thank you for your answer! I have read on many pages about this issue, but not gonna lie, this looks like chinese for me.
I'm uploading the data to the phpmyadmin database through this line:
$category_query = "SELECT * FROM categories";
$categories = mysqli_query($connection, $category_query);
if (isset($_GET['id'])) {
$id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
}
|
|
|
|
|
Quote: this looks like chinese for me. Then I suggest you spend time studying PHP before trying to use advanced topics: see PHP Tutorial[^]
|
|
|
|
|
I've spent the past month to get this small project to work and other than that, I have nothing to do with PHP. So, in order to fix a few small issues, I really don't want to learn coding in PHP. That's why I made a gamble and post it here.
Thank you for your time and your tip!
|
|
|
|
|
hello,
On my site in ASP.Net MVC, I try to send the contents of an array in a function using a POST but nothing happens and I don't understand why.
My class :
public class AdresseIP
{
public int? Idclient { get; set; }
public int? ip1 { get; set; }
public int? ip2 { get; set; }
public int? ip3 { get; set; }
public int? ip4 { get; set; }
public int? idplan { get; set; }
}
My function (empty for the moment):
[HttpPost]
public ActionResult MAJIP(IEnumerable<AdresseIP> lst)
{
return View(1);
}
The method I use to send the array from my page:
function Valider(tableID) {
console.log("test " + tableID);
var IPs = new Array();
$("#" + tableID + " TBODY TR").each(function () {
var row = $(this);
var IP = {};
IP.Idclient = row.find("TD").eq(0).text();
IP.idplan = row.find("TD").eq(1).text();
IP.ip1 = row.find("TD").eq(2).text();
IP.ip2 = row.find("TD").eq(3).text();
IP.ip3 = row.find("TD").eq(4).text();
IP.ip4 = row.find("TD").eq(5).text();
IPs.push(IP);
});
console.log(JSON.parse(JSON.stringify(IPs)));
IPs2 = JSON.parse(JSON.stringify(IPs));
console.log(IPs2);
$.ajax({
type: "POST",
url: "/IP/MAJIP/",
data: IPs2,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
alert(r);
if (r == 1) {
console.log('test1 ' + r)
} else {
console.log('test2 ' + r);
}
}
});
}
The console.log(IPs); displays the contents of the array correctly.
There may be better methods, but I don't know of any.
When I validate, my function receives a Null. Yet all my console.log(IPs); return the expected value.
So here I don't know.
Any idea please?
|
|
|
|
|
I created a .Net Web API and I'm trying to host it in IIS on my server which is running 2012 R2. I'm kind of new to setting this up, but it seems pretty simple, or so I thought.
First, in IIS I went into Server Certificates and created a Self Signed Cert. I gave it the name "My Cert" and selected "Personal".
Next, I addd a new Web Site called "My API", set the IP address to 1080, selected HTTPS and seleced the cert I created.
Next, I opened port 1080 on the firewall.
I then clicked Browse *:1080 and the browser opens, but it has a cert error that says
There is a problem with this website's security certificate.
The security certificate presented by this website was issued for a different website's address
I dont understand what it means by "issued for a different website's address", as nowhere did I get asked to give the cert a website address.
I'm guessing I'm doing this wrong somehow. I could use some help.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 24-Jul-22 2:42am.
|
|
|
|
|
A self-signed certificate created via IIS will only work for "localhost".
If you want to create a self-signed cert for a different host, you'll need to specify the common name for it. For example, in Powershell:
New-SelfSignedCertificate -DnsName "your-host-name" -CertStoreLocation "cert:\LocalMachine\My" New-SelfSignedCertificate (pki) | Microsoft Docs[^]
If you're planning on accessing the API from outside of your own network, you'll want a real cert for a real external hostname. Assuming the DNS resolves correctly, you can probably use Let's Encrypt[^] to get a free cert.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for the info.
Richard Deeming wrote: If you want to create a self-signed cert for a different host
I'n not sure what 'host' means here. I'm not sure what the host is. I'm trying to connect from my Dev PC to my server via IP address (192.168.###.###).
Richard Deeming wrote: PowerShellCopy Code
New-SelfSignedCertificate -DnsName "your-host-name" -CertStoreLocation "cert:\LocalMachine\My"
I would run this on the server?
Sorry, I've only set this up one and it was 10+ yeas ago.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 25-Jul-22 15:23pm.
|
|
|
|
|
The host is the name you're connecting to - typically the part between http(s):// and the port number or path. For example, when you connect to CodeProject, the host is "www.codeproject.com".
Yes, you would need to run the Powershell to generate the cert on the server.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm connecting from within my network via IP. So for the cert the hostname would be 192.168.###.###?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
That should work, but I've never tried binding a cert to an IP address. Is there some reason you can't use the host name instead?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I guess I could. But I would be making one up as I have no host name. Could I just use "www.mysite.com"?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Yes, if you can edit the hosts file on the machine that's making the connection.
Otherwise, just use the name of the machine you're connecting to.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
OK, so I can do:
New-SelfSignedCertificate -DnsName "marois_dev_1" -CertStoreLocation "cert:\LocalMachine\My" where marois_dev_1 is my server name?
and run this in PowerShell on my server.
Then use that cert in IIS on my server?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Yes, that should work.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Would a site name of localhost or 127.0.0.1 / 127.0.0.0 work?
|
|
|
|
|
That would only work if your client was running on the server. The localhost name and the loopback address always point to the current computer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: New-SelfSignedCertificate -DnsName "your-host-name" -CertStoreLocation "cert:\LocalMachine\My"
Can you clarify the -CertStoreLocation here? I don't understand where the cert was created?
Thank you
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
It's created in the "computer account" certificate store, under the "Personal" folder.
It won't appear in certutil.msc ; you'll need to open up MMC, add the certificates snap-in, and select "computer account".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard, thanks for your help so far, however, I'm still stuck on this and could use some more help.
Here's what I;ve done so far:
1 - Created a self-signed cert. Here
2 - The Cert appears in the cert store. Here
3 - The cert appears in IIS. here
4 - Add the API in IIS using the cert. Here
5 - Browse the site in IIS. I still get the cert error. Here
I'm guessing that I'm still missing something.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|