任何人都请帮助我,我是PHP编程的初学者,我的代码有问题,我使用头函数打开URL,我想同时执行这2个头,但第一个头没有工作(电报信息没有发送),但如果我评论第二个标题,则消息传递成功。
第一个标题是将数据发送到电报,在消息传递给电报用户后,我想重定向到index.php
这是我的代码:
/* the message didnt sent */
header('location: https://api.telegram.org/botTOKEN/sendMessage?chat_id=123456789&text=THANKYOU);
header('location:index.php');
/* the message sent */
header('location: https://api.telegram.org/botTOKEN/sendMessage?chat_id=123456789&text=THANKYOU);
//header('location:index.php');
有没有办法做这种散文?首先,我想向电报用户发送消息,消息发送成功后,我想重定向到index.php
页面。
答案 0 :(得分:0)
你的逻辑错了。使用 1) pull
docker pull jboss/wildfly
2) vi Dockerfile
FROM jboss/wildfly
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin123$ --silent
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
3) Extend docker image
docker build --tag=nbasetty/wildfly-server .
4) [root@centos7 custom-jboss]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nbasetty/wildfly-server latest c1fbb87faffd 43 minutes ago 583.8 MB
docker.io/httpd latest e0645af13ada 2 weeks ago 177.5 MB
5)vi jboss-wildfly-rc-service-custom.yaml
apiVersion: v1
kind: Service
metadata:
name: wildfly-service
spec:
externalIPs:
- 10.0.2.15
selector:
app: wildfly-rc-pod
ports:
- name: web
port: 8080
#- name: admin-console
# port: 9990
type: LoadBalancer
---
apiVersion: v1
kind: ReplicationController
metadata:
name: wildfly-rc
spec:
replicas: 2
template:
metadata:
labels:
app: wildfly-rc-pod
spec:
containers:
- name: wildfly
image: nbasetty/wildfly-server
ports:
- containerPort: 8080
#- containerPort: 9990
6) kubectl create -f jboss-wildfly-rc-service-custom.yaml
7) [root@centos7 jboss]# kubectl get pods
NAME READY STATUS RESTARTS AGE
mysql-pvc-pod 1/1 Running 6 2d
wildfly-rc-d0k3h 0/1 ImagePullBackOff 0 23m
wildfly-rc-hgsfj 0/1 ImagePullBackOff 0 23m
[root@centos7 jboss]# kubectl logs wildfly-rc-d0k3h
Error from server (BadRequest): container "wildfly" in pod
"wildfly-rc-d0k3h" is waiting to start:
trying and failing to pull image
将用户发送到另一个网页,因此通过堆叠它们,浏览器只会成功重定向到最后一个网页。您可能想要的是将这些页面称为服务器端,然后再重定向用户:
header('Location: ')