douqixia7942 2019-05-03 22:30
浏览 24

如何使用php从电子邮件中获取@符号后的数据

i am trying to get the data After an '@' sign from an email address, this is what i am trying to do i am using the $_GET['email'] to get the email from the url, now i want to extract the data after the @, store the data in a variable then send the user to that domain eg: email@gmail.com i want to get the gmail.com, store it and then send the user to gmail.com

this is all i have tried but all gives me the same error 1:

    $domain1 = $_GET['email'];    
    $domain = substr($domain1, strpos($domain1, "@") + 1); 
    // then am using the header location to send the user to the gmail.com
    header('Location: http://$domain');

2:

       $domain1 = $_GET['email'];
       $domain2 = strtok( $domain1, '@' );
       $domain = strtok( '' ); 
       // then am using the header location to send the user to the gmail.com
       header('Location: http://$domain');

this is the error

This site can’t be reached %24domain’s server IP address could not be found.
Try running Windows Network Diagnostics.
DNS_PROBE_FINISHED_NXDOMAIN

if you read the error message it is trying to redirect to %24domain and i don't know where its getting that from

i have tried all the Technics related to this i saw from this forum but i still get the same error

guys please help

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?