|
<pre>Hi, can someone please help me with a task that I am struggling with.
I need to create a React app that:
○ Contains a Dropdown that allows a user to select which functionality
they want to use on my site. The options should be ‘Currency
converter’ and ‘Win!’.
○ Contains a component that converts currencies. This component
should be displayed when the user selects ‘Currency converter’ from
the Dropdown. The user should be able to enter a figure in dollars
and the app should calculate and display the amount in South
African Rands, UK pounds and Euros. The components that display
the converted values should be children of the conversion
component.</pre>
|
|
|
|
|
Don't you think you were given this assignment to learn how to do it?
They don't give you assignments that you can just knock out in a few minutes - they give you assignments that will make you extend what you should have already learned.
A question to ask yourself: if you are already looking for someone to do the "hard work" for you, what will you do as more difficult levels of programming arise? Maybe you should go into a field more suited to your personality and abilities
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
The requirement request sounds like school work. It also shows no effort to solve the problem and has no specific issue we can help with.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
|
So when i use the mailto it will change the page to write the email.
But i want the user to open that in a new tab and have the possibility to change their email and not only use the default email that is on user's browser.
this is what i have:
<a href="mailto:myemail@gmail.com">myemail@gmai.com</a>
is possible to do that with mailto?
|
|
|
|
|
Although this is possible, but this would give a rather poor UX to the users; I would highly recommend that you just use the mailto prefix and let the user handle how they wish to send their email. This is easy, and beautiful in terms of UX/UI.
If you want to control this, then prevent the browser from handling the mailto link, this would mean that you need to control the click-event on the mailto hyperlink and then you also need to manage:
- Opening a new tab for the user
- Managing the actions of the user in that new tab
- Closing the tab after they are done
Which is a lot cumbersome. Any specific reasons to do this, so that we may help you better?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I have 2 pages. 1st is the index.php that have 3 fields. 2 of them should saved to sql and its works fine and the 3rd one should pass the value to 2nd screen. I have JS file. I success doing these 2 operations successfuly but in seperated projects. When I am trying to make them together there are mistakes. I want to know How can I implement those 2 parts together please.
index.php
<pre><!DOCTYPE html>
<html>
<head>
<title>PHP MySQL Insert Tutorial</title>
<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>
</head>
<body>
<form action='insert.php' method='post' id='myform' >
<p>
<input type='text' name='username' placeholder='user name' id='username' />
</p>
<p>
<input type='text' name='password' placeholder='password' id='password' />
</p>
<p>
<input id = "minus" type="text" name="main" value="<?php echo $num1; ?>" autocomplete="off">
</p>
<button id='insert'>Insert</button>
<p id='result'></p>
</form>
</body>
</html>
2nd.php
<?php
session_start();
if(isset($_POST['Submit']))
{
$num_2 = "";
$pass_num = $_POST['main'];
}
?>
<h2>minus</h2>
<br>
<form method="post" action="index.php">
<input type="text" name="state" value="<?php echo $num_2;?>" autocomplete="off">
<br>
<input type="hidden" name="rrr" value="<?php echo $pass_num;?>" autocomplete="off">
<br>
<br>
<input name="Submit" type="submit" value="Submit">
</form>
jS
$('#myform').submit(function(){
return false;
});
$('#insert').click(function(){
$.post(
$('#myform').attr('action'),
$('#myform :input').serializeArray(),
function(result){
$('#result').php(result);
}
);
});
modified 21-Jul-20 7:04am.
|
|
|
|
|
One thing I see right away: your 2nd.php form submit's to index.php but the values you pass from the form are never looked for in index.php.
So what's the point of that interaction?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I created an Asp.Net Core Web API project. By default it comes with a "WeatherForecastController". I run the app at "https://localhost:44368/weatherforecast", a browser opens, and I get JSON back. All's fine.
Next, I added a controller called Test with code to call my DAL (See code below) and when I try "[https://localhost:44368/Test/GetAll] I get a Not Found. . What's the right way to call these methods on the controller? Is there some routing config that I need?
[ApiController]
[Route("[controller]")]
public class TestController : _ControllerBase
{
[HttpPost]
public int Add(TestDataEntity entity)
{
try
{
IRepository repo = GetRepository<TestDataRepository>();
return repo.Add(entity);
}
catch (Exception e)
{
throw;
}
}
[HttpDelete]
public void Delete(int id)
{
try
{
IRepository repo = GetRepository<TestDataRepository>();
repo.Delete(id);
}
catch (Exception e)
{
throw;
}
}
[HttpGet]
public TestDataEntity Get(int id)
{
try
{
IRepository repo = GetRepository<TestDataRepository>();
return repo.Get(id);
}
catch (Exception e)
{
throw;
}
}
[HttpGet]
public List<TestDataEntity> GetAll()
{
try
{
IRepository repo = GetRepository<TestDataRepository>();
return repo.GetMany();
}
catch (Exception e)
{
throw;
}
}
[HttpPost]
public void Update(TestDataEntity entity)
{
try
{
IRepository repo = GetRepository<TestDataRepository>();
repo.Update(entity);
}
catch (Exception e)
{
throw;
}
}
}
When I run this
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I've just tried this simpler version:
[ApiController]
[Route("[controller]")]
public class TestController : ControllerBase
{
private static readonly string[] Values =
{
"Foo", "Bar", "Baz"
};
[HttpGet]
public IEnumerable<string> GetAll() => Summaries;
[HttpGet]
public string Get(int index) => Summaries[index];
} With that, I get an ambiguous match exception:
The request matched multiple endpoints. Matches:
TestCoreApi.Controllers.TestController.GetAll (TestCoreApi)
TestCoreApi.Controllers.TestController.Get (TestCoreApi) After changing the route on the Get method, it works as expected:
[HttpGet("{id:int}")]
public string Get(int index) => Summaries[index];
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am making php page.
In my php page, exit() function calls in serveral places and i declared sqlite3::open() function in first line of php.
Closing db before each exit function makes code complex.
So i don't close sqlite db at the end is ok?
Please help me
|
|
|
|
|
Member 14490964 wrote: In my php page, exit() function calls in serveral places You need to redesign your page.
|
|
|
|
|
|
Detail of what? We have no idea what your code does or why. It is up tp you to review it and figure out why you have all these exit calls, and why you are leaving open databases if the code terminates.
|
|
|
|
|
please sir, i am new in web application development. and i am in desprate need of PHP and MSQLI codes that can link my php page to a form in excel sheet and at after the form is filled, once i click the send button it sends the information to database.
|
|
|
|
|
|
Database data export is a familiar operation for many of us. phpMyAdmin is the go to choice for a database client in PHP. It provides database administration tools and also allows exporting the data. The exported data can be in various formats like SQL, CSV as selected.
Please let me know if below code is useful. I used it for adding same functionality on my website here.
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO MyGuests (firstname, lastname, email)
VALUES ('John', 'Doe', 'john@example.com')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
Here is another good reference https://phppot.com/php/database-data-export-to-excel-file-using-php/
|
|
|
|
|
I am using xampp apache server.
The server domain is registered in cloudflare.
All works well.
But cloudflare ip is saved in access.log
So I have done googling about restore real ip of cloudflare.
But I only found the way in linux apache server.
How can i resotore real ip in access.log of xampp server registered in cloudflare.
|
|
|
|
|
Message Removed
modified 14-Jul-20 15:02pm.
|
|
|
|
|
Hi all,
I did a small database and web page to help me control the time I work for my customers...
Today I've thought on adding graph capabilities to perform reports.
Given this thing is coded using PHP, some jquery and used a MySQL database, what would you recommend me?
I'm searching for a good looking free graph library.
Thank you all!
|
|
|
|
|
I want to redirect from http to https using express framework.
It is my code and it works properly, but i am not sure is it right way to redirect from
http to https. Anybody knows is my solution right?
var fs = require('fs');
var https = require('https');
var config = require( ".\\config\\config.json");
var folder = __dirname + '\\SSLCERT\\';
var fkey = folder + 'privatekey.key';
var fcert = folder + 'certificate.crt';
var privateKey = fs.readFileSync(fkey, 'utf8');
var certificate = fs.readFileSync(fcert, 'utf8');
var credentials = {key: privateKey, cert: certificate};
var express = require('express');
var app = express();
var https_mode = false;
app.get('/', function (req, res) {
if (https_mode == false) {
res.redirect('https://localhost:' + config.port_https);
https_mode = true;
}
else{
res.send('Hello World!!!');
https_mode = false;
}
})
app.listen(config.port_http,()=> {
console.log('listening on ' + config.port_http);
});
var httpsServer = https.createServer(credentials, app);
httpsServer.listen(config.port_https, () => {
console.log('listening on ' + config.port_https) });
|
|
|
|
|
Hi All,
I have a thousand odd points of data, (city,state) describing the countries top high schools. I was wondering what an effective way to graph this would be.
I have the data in a PDF, so I'm currently working on scraping that into .CSV form.
Does the city/state location need to by long/latitude? I see a number of tools out there, just wondering what is the easiest to get started on a project like this.
My background is Linux Admin, some HTML and of course bash scripting. I would like to learn how to do this using golang if possible.
Thansk!
|
|
|
|
|
I think other people can give better answers but if all goes to hell, you can try with Python. Python has extensive libraries to help you in this regard.
|
|
|
|
|
if an airline booking tickets website is hard to do ?
and what is best website idea i can do it for a project?
|
|
|
|