-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (62 loc) · 1.71 KB
/
index.html
File metadata and controls
72 lines (62 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mini PHP Server Launcher</title>
<style>
body {
font-family: sans-serif;
background: #222;
color: #0f0;
padding: 2em;
}
input, select, button {
padding: 0.5em;
margin: 0.5em 0;
font-size: 1em;
width: 300px;
background: #111;
border: 1px solid #444;
color: #0f0;
}
button {
background: #0f0;
color: #000;
cursor: pointer;
}
</style>
</head>
<body>
<h2>🛠 PHP Server Launcher</h2>
<label>🧩 انتخاب نسخه PHP:</label>
<select id="phpVersion">
<option value="php-8.2.0-nts-Win32-vs16-x64">PHP 8.2</option>
<option value="php-8.1.0-nts-Win32-vs16-x64">PHP 8.1</option>
<option value="php-7.4.0-nts-Win32-vs16-x64">PHP 7.4</option>
</select>
<label>🔌 پورت:</label>
<input type="number" id="port" value="8000" />
<br>
<button onclick="generateBat()">🎬 اجرا کن</button>
<p id="status"></p>
<script>
function generateBat() {
const phpVer = document.getElementById('phpVersion').value;
const port = document.getElementById('port').value;
const content = `@echo off
set location=%cd%
echo Starting MySQL...
start "" "C:\\laragon\\bin\\mysql\\mysql-5.7.33-winx64\\bin\\mysqld.exe" --console
echo Starting PHP server on port ${port}...
start "" "%location%\\${phpVer}\\php.exe" -S localhost:${port} -t .
pause`;
const blob = new Blob([content], { type: 'text/plain' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = 'start.bat';
a.click();
document.getElementById('status').innerText = '✅ فایل start.bat ساخته شد! آن را اجرا کنید.';
}
</script>
</body>
</html>